Brew Jupyter Notebook

Posted on  by 



  1. Brew Jupiter Notebook Template
  2. Jupyter Notebook Windows
  3. Brew Jupiter Notebook App
  4. Jupyter Lab Windows 10

A package that works like the Jupyter Notebook, but inside Atom. It's registered as an opener for .ipynb files — try opening one!

Install

  1. Install dependencies:
  1. How to install gensim in jupyter notebook. Gensim PyPI, First, I'll provide a quick, bare-bones answer to the general question, how can I install a Python package so it works with my jupyter notebook, Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. Learn more Gensim Library not recognized in Jupyter notebook.
  2. I have successfully installed Maxima-Jupyter on macOS using Homebrew. Brew uninstall maxima # (if you have already installed) brew install sbcl gpg zmq gnuplot brew edit maxima. Will installing Jupyter Notebook mess up the Hydrogen package in Atom? Installing pyqt5 with homebrew just for python2.
Jupyter

Jupyter (formerly IPython Notebook) is an open-source project that lets you easily combine Markdown text and executable Python source code on one canvas called a notebook. Visual Studio Code supports working with Jupyter Notebooks natively, as well as through Python. 在 Jupyter Notebook 中使用 Node.js. 由于 Jupyter Notebook 默认只支持 Python, 因此,若想在 Jupyter Notebook 中使用其他语言,则需要自行添加支持,而这里的额外支持,就是自行安装 Jupyter 的 Node.js 内核. Brew install zmq pkg-config.

OS X
  • Python 3: brew install python3 (there are issues with pip2 and OS X 10.11)
  • Jupyter and Jupyter Kernel Gateway: pip3 install jupyter jupyter_kernel_gateway
Linux (Debian)
  • Python: sudo apt-get install python python-pip
  • Jupyter and Jupyter Kernel Gateway: pip install jupyter jupyter_kernel_gateway
  1. apm install jupyter-notebook or search for jupyter-notebook inside of Atom

Usage

  • Run cell: SHIFT+ENTER, CMD+ENTER (or CTRL+ENTER on Windows)

Brew Jupiter Notebook Template

Developers

Install

  1. git clone https://github.com/jupyter/atom-notebook.git
  2. apm install
  3. apm link

Achitecture

This package is built on React and the Flux architecture.

Map

  • main tells Atom how to render NotebookEditor and registers as an Opener for .ipynb files
  • dispatcher is a singleton flux.Dispatcher which contains the list of valid actions
  • notebook-editor is the Store and handles all of the business logic. It loads the file in, creates a state, then receives Actions and updates the state accordingly.
  • notebook-editor-view, notebook-cell, text-editor, display-area are the views. notebook-editor-view updates its state by fetching it from notebook-editor, then passes appropriate bits of that state down to the other views as props.

Flow

Rendering:NotebookEditor -> NotebookEditorView -> [child views]

Updating:[external action] -> Dispatcher.dispatch -> NotebookEditor.onAction ?-> NotebookEditor._onChange -> NotebookEditorView._onChange

Immutable state

The state returned by NotebookEditor.getState is an Immutable.js object.

Accessing its properties inside a view looks like this:

Changing it (in NotebookEditor) looks like this:

or this:

Since React requires a view's state to be a regular JS object, the state of NotebookEditorView takes the form:

No other views have state.

To do

Windows
  • autocomplete
    • atom.workspace.getActiveTextEditor() returns undefined because atom.workspace.getActivePaneItem() returns our custom NotebookEditor class which contains one or more TextEditors, therefore autocomplete, find, and features provided by other packages don't work in cells
  • add more actions (duplicate cell, restart kernel, change cell type, etc)
  • tell React our rendering is pure
  • test rendering performance with big notebooks

Update (April 3, 2016): Since posting this a little over year ago a great deal has progressed on this front. Notably, Jupyter has moved on to 4.x, and as pointed out in the comments, you can follow specific instructions on installing the R kernel for the Jupyter notebook 4.x+ here.

Nonetheless, the information below may be useful for walking through the more basic steps needed if you are relatively new to programming or software development. It also may explain steps that are just listed as instructions in the official page. The hope is that there is value in this post, even though there are new resources for ealing with newer versions of the notebook.

Initial instructions & preliminaries

Brew

Examine the IRkernel instructions (i.e., read the README.md file). Below are a few preliminary questions that you might run up against if you are new to programming[1]. If you are an experienced programmer and know the meaning of 'terminal', brew, pip, git, IPython, or Jupyter, you may wish to skip to the section called Installing R and devtools.

  • Do you know how to open a terminal window? Try pressing ⌘+space to open Spotlight[2] (a OSX tool) and type “Terminal” into the bar that opens.
    • What do you use as your terminal emulator? If the regular terminal, I would suggest downloading and installing iTerm2, it will make your life easier.
  • Do you know how to use brew? If not, read this explanation.
  • This entire walkthrough will not be very useful unless you already have python(2.7 or 3) and IPython installed. Go to the IPython installation site to set up IPython.
    • Note, python 3 and IPython 3 are very different things.
      • python 3 is the officially sanctioned version of python which is contrasted often with python 2.7 which has extensive library support, but which will not be developed any further by the core python development team.
      • IPython 3 is version of IPython that was recently released. IPython stands for 'interactive python' and is equipped with a powerful in-browser interactive editor known as the IPython notebook. As you might guess from the title of this walkthrough, this editor can run R. The project has recently split into two parts IPython and Jupyter. The details of this split have largely to do with the former focusing on python specifically with the latter focusing on language agnostic capabilities (such as the R kernel that we will be installing). IPython 3.x will be the last release of IPython that includes the notebook. More information about the two projects can be found at the IPython site and the Jupyter site.
    • If you already have python, but do not have IPython or the IPython notebook installed, try running pip install 'ipython[notebook]'.
      • If you don’t have pip or know what pip is, read this website. If you want to rush blindly into the future without knowing what exactly you’re doing, then you can run easy_install pip(or if you have root access[3]sudo easy_install pip), which will allow the previous command to work.

Installing R and devtools

Firefox 65. Run R from the command line to open an R terminal, then, run the command install.packages('devtools').

  • If you do not have R installed, run brew install r. Be aware — because of the number of required packages, this can take a while to finish.
  • If you have R installed, but you run into issues regardless, try instead running brew upgrade r.
  • Hint: If you don’t know how to run R from the command line, but you have installed try typing R or r in your bash terminal (i.e., capitalization doesn’t matter).
  • If after doing this, you still cannot get install.packages('devtools') to work after installing via brew. Go to R’s homepage and download and install the latest version from their pkg installer (at time of writing this is R 3.1.2).

Dealing with a common issue: rzmq

At this point if you continue with the instructions at the IRkernel github page, you may run into the issue that is discussed here regarding the lack of availability of rzmq given the current way that install_github works (especially since it is also absent from CRAN).

  • To get this you will need to have a working version of git, which comes with the XCode command line tools and if you attempt to use git from the command line and you do not have it installed, it will prompt you to install it.
    • Even better would be to follow the instructions here that describe how to update git to a more recent version than that installed by Apple while moving your Apple version of git to its own separate directory.

  • First, check that you have basic bindings for ZeroMQ (which is what zmq refers to). Do not worry if it says you already have them, if you want to update them instead, just change install to update.

  • Shuttl laptops & desktops driver download for windows. With that in place you want to recursively clone the git repository that has the relevant rzmq build, which you can do by putting the following line into your terminal (which will clone it to your current working directory, which you can see by typing pwd).

  • And then without navigating to any other directory (this is key for the work around to work), `r`, and once the R terminal is running, paste the following commands:

  • If you are using IPython 3 then insert the following command as well.

Payoff: Checking to make sure it works.

Go to your command line prompt once again (i.e., open a new Terminal or iTerm2 window), and run the following command:

This should open a window in your web browser of choice. If you have IPython 3 installed, in the upper right hand corner you should see menu-button that says “New ▾” (see the item pointed to in the following picture):


If everything has worked out well, click this menu-button you should see (at least) the following options:

Jupyter Notebook Windows


Brew Jupiter Notebook App

Which means all you need to do now to run R in a jupyter/IPython notebook is to click the letter “R”. A new window should open with an R kernel that is ready to go.

Brew install jupyter notebook

If you’ve gotten this far, well done! Enjoy your new R environment!

Updated: 2015_20_7_1648. Thanks to Alistair Walsh, Andrew Lonsdale and johnlaudun for their comments which helped me improve this since originally posting it.

Jupyter Lab Windows 10

  1. My aim with this tutorial is to make it accessible to literally anyone who can read English text and has access to OSX and the internet. This means that some of my explanations may seem rudimentary, but I find that too few instances of someone actually going through ↩

  2. If you have another application launcher installed then this will also work. I merely assumed that people who do not know what the terminal is probably do not know that launchers exist, though I surely could be wrong. ↩

  3. sudo is an abbreviation for “substitute user do” though it is also commonly said to be an abbreviation for “super user do”. The wikipedia entry on sudo does a better job of explaining this than a footnote to a 3rd level indented list item ever could(see also). ↩





Coments are closed