简体   繁体   中英

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:

在此输入图像描述

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 

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!

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).

I had similar issue but looks like this its because I was using python 2.7 . I was able to launch notebook by clicking on "Python 2" dropdown option.

I had the same problem, it is because I installed ipython with sudo apt-get -y install ipython ipython-notebook instead of sudo pip install ipython . Therefore, uninstall all ipython stuff using: sudo apt-get --purge remove ipython sudo pip uninstall ipython

and then install it with pip

I was also getting the same error. My error snapshot is here . Following below solved my problem:

  1. sudo apt-get -y install ipython ipython-notebook
  2. sudo -H pip install jupyter

It was not working because I was getting 0 active kernel message and this came because I installed jupyter using step2 only (skipped step1).

如果有人仍然有这个问题,对我来说它是通过运行解决的

pip install --upgrade ipykernel

because ipython version is too new. you can use follow commands

pip uninstall ipython
pip install ipython==5.1

Also, check if you have cookies enabled in your browser. Without cookies, the listing of the directory appears empty, as does the notebook creation menu.

For me the error was:

ERROR: notebook 6.0.0 has requirement tornado>=5.0, but you'll have tornado 4.5.3 which is incompatible.

I solved it by following the below steps:

pip uninstall ipykernel
pip install --upgrade tornado
pip install ipykernel

Now open jupyter notebook from terminal. It should work fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM