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.
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.
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:
sudo apt-get -y install ipython ipython-notebook
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).
If anyone is still having this issue, for me it was solved by running
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.
Related
This has been asked many times - but I cannot for the life of me get rid of jupyter notebook/jupyterlab. I want to not be able to run a jupyter notebebook so that I can re-install everything.
I have tried the simple
pip uninstall jupyterlab pip uninstall notebook pip uninstall jupyter also with pip3 options
I have tried
$ pip3 install pip-autoremove
$ pip-autoremove jupyter -y
and changed pip3 for pip in case that made a difference.
I have followed what has been suggested with this answer
The output to which jupyter is /usr/local/bin/jupyter. I tried sudo /usr/local/bin/python -m pip uninstall jupyter following the comment answer this question.
Whenever I try remove it I just get Skipping jupyter as it is not installed. errors, yet if you run jupyter notebook it runs, and which jupyter continues to return a result.
It was suggested that I re-install Python3, but Jupyter Notebook is running Python2 (on a mac, so can't get rid of that), and I can't uninstall Python3 either following any instructions I can find.
Is there any way to get rid of this program from a mac when all the above fail to do anything?
Far as I know it was installed with pip, but I also checked if it was installed through conda (conda not recognised as a command)
I am running macOS Mojave Version 10.14.6. Python versions are
$ python --version
Python 2.7.15
$ python3 --version
Python 3.6.5
I had a problem with jupyter notebook. Every time I started a notebook, kernel died.
So, I decided to uninstall jupyter notebook using pip:
pip uninstall jupyter notebook
After successful uninstallation, I installed again, using same pip:
pip install jupyter notebook
Then, as usually, I typed in cmd:
jupyter notebook
But got this error:
'jupyter' is not recognized as an internal or external command,
operable program or batch file.
So I checked the location of IPython, and found out that now the right file, which I want to call is jupyter-notebook, which different from jupyter notebook by dash sign. If I run jupyter-notebook from cmd everything works.
Can anyone explain, what happened and why the file now called jupyter-notebook?
Thank You
Because pip uses the legacy Python 2.
Use pip3 to install:
pip3 install --upgrade pip
pip3 install jupyter
jupyter notebook #to start jupyter notebook
I highly recommend installing Anaconda.
Download Anaconda here.
Then use :
bash
to install it.
Good Luck.
A solution without installing Anaconda, or conda:
sudo easy_install pip==20.3.4
pip2 install virtualenv
virtualenv jupyter
source jupyter/bin/activate
pip2 install jupyter
jupyter notebook
This solution was tested on:
Distributor ID: Ubuntu
Description: Ubuntu 16.04.7 LTS
Release: 16.04
Codename: xenial
It was run on 32bit Chromenotebook, with Firefox vs NetSurf installed on xenial
Jupyter notebook will be open automatically. However, everytime loging in on Jupiter again, at first source needs to be activated:
source jupyter/bin/activate
and then:
jupyter notebook
to start
I recommend that you always use conda instead of pip to install the Jupyter Notebook.
In your case, for example, I will recommend:
conda install jupyter notebook
and not pip install jupyter notebook I can see that most of the problems that you described there are environment related and hence you can often run into environment issues while using pip to install jupyter
I have Jupyter Notebook installed and working. However it only has python 2 kernel.
I tried reinstalling Anaconda with Python 3.6 version of python, which worked fine (apart from deleting all my environments, etc.), but no change in relation to the kernels available for Jupyter.
I have tried installing jupyter using pip (the solution to this question), but I get the error message Requirement already satisfied: jupyter in c:\users\username\anaconda2\lib\site-packages
Any ideas?
Are you using pip3 install jupyter?
a more robust solution would be to isolate your environments with something like pipenv.
pip install pipenv
pipenv install --three
this will install a virtual environment with python3
install packages
pipenv install jupyter
activate the env
pipenv shell
start the notebook
jupyter notebook
You should be able to see the python3 option now.
When I execute jupyter notebook in my virtual environment in Arch Linux, the following error occurred.
Error executing Jupyter command 'notebook': [Errno 2] No such file or directory
My Python version is 3.6, and my Jupyter version is 4.3.0
How can I resolve this issue?
It seems to me as though the installation has messed up somehow. Try running:
# For Python 2
pip install --upgrade --force-reinstall --no-cache-dir jupyter
# For Python 3
pip3 install --upgrade --force-reinstall --no-cache-dir jupyter
This should reinstall everything from PyPi. This should solve the problem as I think running pip install "ipython[notebook]" messed things up.
For me the issue was that the command jupyter notebook changed to jupyter-notebook after installation.
If that doesn't work, try python -m notebook, and if it opens, close it, then
export PATH=$PATH:~/.local/bin/, then refresh your path by opening a new terminal, and try jupyter notebook again.
And finally, if that doesn't work, take a look at vim /usr/local/bin/jupyter-notebook, vim /usr/local/bin/jupyter, vim /usr/local/bin/jupyter-lab (if you have JupyterLab) and edit the #!python version at the top of the file to match the version of python you are trying to use. As an example, I installed Python 3.8.2 on my mac, but those files still had the path to the 3.6 version, so I edited it to #!/Library/Frameworks/Python.framework/Versions/3.8/bin/python3
Try this command: python -m IPython notebook
Credits to the GitHub user Milannju who provided the solution here.
This worked for me. (Python 3.6 on Ubuntu 18.04 LTS)
export PATH=$PATH:~/.local/bin/
On Ubuntu 18.10, the following command helped me out.
sudo apt-get install jupyter-notebook
Jupyter installation is not working on Mac Os
To run the jupyter notebook:-> python -m notebook
Use the command below and if you are using pip3 replace pip by pip3
pip install --upgrade --force-reinstall jupyter
This worked for me.
Since both pip and pip3.6 was installed and
pip install --upgrade --force-reinstall jupyter
was failing, so I used
pip3.6 install --upgrade --force-reinstall jupyter
and it worked for me.
Running jupyter notebook also worked after this installation.
Deactivate your virtual environment if you are currently in;
Run following commands:
python -m pip install jupyter
jupyter notebook
For me the fix was simply running pip install notebook
Somehow the original Jupiter install got borked along the way.
I'm trying to get this going on VirtualBox on Ubuntu. Finally on some other post it said to try jupyter-notebook. I tried this and it told me to do sudo apt-get jupyter-notebook and that installed a bunch of stuff. Now if I type command jupyter-notebook, it works.
If you are on Fedora installing python3-notebook resolved my problem.
# dnf install python3-notebook
I have jupyter installed with python3.5 on my Mac OSX, but I want the python2.7 version. So, I basically need to uninstall the 3.5 version, and reinstall the 2.7 version.
But for some reason I can't uninstall the 3.5 version. I tried sudo python3 -m pip uninstall jupyter, and you can see the results below:
✔ ~/current/directory
20:08 $ which jupyter
/Library/Frameworks/Python.framework/Versions/3.5/bin/jupyter
✔ ~/current/directory
20:08 $ sudo python3 -m pip uninstall jupyter
The directory '/Users/<username>/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Cannot uninstall requirement jupyter, not installed
The directory '/Users/<username>/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
You are using pip version 8.1.1, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
✘-1 ~/current/directory
20:09 $ which jupyter
/Library/Frameworks/Python.framework/Versions/3.5/bin/jupyter
...as you can see above, the which jupyter command still returns a valid path, AND not only that. I'm still able to launch jupyter notebook from the command line, and it opens a notebook.
How do I correctly get rid of my existing version of jupyter ? OR, if someone knows how to ADD a python2 kernel to my existing jupyter, that would be fine too. Is that possible?
All I can think of is to manually kill the files and subfolders inside of /Library/Frameworks/Python.framework/Versions/3.5/bin/, but this seems unnecessarily brutal?
The answer over here solved my problem: https://stackoverflow.com/a/42277762/8057434
I'll just summarize what to do.
Run
conda uninstall notebook nbconvert nbformat ipykernel ipywidgets qtconsole traitlets tornado jupyter_* ipython_genutils jinja2 -y
in your terminal.
You can use pip uninstall instead of conda uninstall if you aren't using anaconda.
From your home folder, delete ~/AnacondaProjects. After that remove the export of Anaconda environment variable from your bash profile ~/.bashrc .
Use pip3 instead of pip
pip3 uninstall jupyter
You can install for both python 2 and python 3 on the same computer as long as you use the correct pip version
I have jupyter installed with python3.5 on my Mac OSX, but I want the python2.7 version.
Anaconda is a great way to install python software that you need for specific projects.
Download from https://www.continuum.io/downloads#macos
as said, bash Anaconda2-4.3.1-MacOSX-x86_64.sh (the 2.7 version in your case)
go to the installed directory and type source bin/activate
This creates a command-line environment which has just the right level of libraries etc. Inside, you can install further data with f.ex. conda install numpy. To fix a version, use conda install numpy=1.10.
You should uninstall the jupyter-core, jupyter-console, jupyter-client seperately. After remove them all, these is no package found named jupyter.