Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jupyter: can't create new notebook?

I have some existing Python code that I want to convert to a Jupyter notebook. I have run:

jupyter notebook 

Now I can see this in my browser:

enter image description here

But how do I create a new notebook? The Notebook link in the menu is greyed out, and I can't see any other options to create a new notebook.

I've noticed this on the command line while Jupyter is running:

[W 22:30:08.128 NotebookApp] Native kernel (python2) is not available  
like image 368
Richard Avatar asked Jan 18 '16 09:01

Richard


People also ask

How do I create a new notebook in Jupyter Notebook?

To create a new notebook, go to New and select Notebook - Python 2. If you have other Jupyter Notebooks on your system that you want to use, you can click Upload and navigate to that particular file. Notebooks currently running will have a green icon, while non-running ones will be grey.

Why is my Jupyter Notebook not working?

Jupyter doesn't load or doesn't work in the browserTry in another browser (e.g. if you normally use Firefox, try with Chrome). This helps pin down where the problem is. Try disabling any browser extensions and/or any Jupyter extensions you have installed. Some internet security software can interfere with Jupyter.

How do I add a notebook to my Jupyter path?

Change Jupyter Notebook startup folder (Windows) Copy the Jupyter Notebook launcher from the menu to the desktop. Right click on the new launcher and change the Target field , change %USERPROFILE% to the full path of the folder which will contain all the notebooks.


2 Answers

None of the other answers worked for me on Ubuntu 14.04. After 2 days of struggling, I finally realized that I needed to install the latest version of IPython (not the one in pip). First, I uninstalled ipython from my system with:

sudo apt-get --purge remove ipython sudo pip uninstall ipython 

I don't know if you need both, but both did something on my system.

Then, I installed ipython from source like this:

git clone https://github.com/ipython/ipython.git cd ipython sudo pip install -e .  

Note the period at the end of the last line. After this, I reran jupyter notebook and the python2 kernel was detected!

like image 144
dangirsh Avatar answered Oct 05 '22 18:10

dangirsh


It looks like you don't have an IPython kernel installed (or any other kernel for that matter!).

There are various ways (old versions, new versions) to do this. One of the simplest ways is to use pip. From the command line enter:

pip install ipython 

You may also need to register the kernel with Jupyter (see the new versions page):

python -m pip install ipykernel  python -m ipykernel install [--user] [--name <machine-readable-name>] [--display-name <"User Friendly Name">] 

You should now be able to launch a Python notebook from Jupyter.

Alternatively, installing Jupyter using any of the methods on this page should ensure that the IPython kernel is already there. Personally, Anaconda has always just worked out of the box for me (when I've used it on Linux and Mac OS).

like image 45
Alex Riley Avatar answered Oct 05 '22 18:10

Alex Riley