jupyter notebook installation issue using pip - python

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

Related

Jupyter notebook not recognised even after installing anaconda and notebook

I installed anaconda in Ubuntu 18.04, then I installed Jupyter notebook using the command:
conda install -c conda-forge notebook
And it the notebooks were opening on using command Jupiter notebook , however, then I installed some packages like python3.8-dev and gcc and after installing them, the command Jupiter notebook is no more recognized. I have even tried reinstalling anaoconda and notebook but that doesn't help. And even worse is that command prompt is not even recognizing python as a command though python3 is already installed. How to cure this?
The command is jupyter notebook and not jupiter notebook

Jupyter Notebook - Python 3 kernel

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.

Matlab kernel in Jupyter [duplicate]

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

-bash: jupyter: command not found

I installed a copy of Anaconda to play around with, but decided I liked Homebrew better, so I removed it. However, this seems to have messed up my install of Jupyter Notebooks, as I can no longer access it. I reinstalled it with pip install jupyter and when I run pip show jupyter I get:
Version: 1.0.0
Summary: Jupyter metapackage. Install all the Jupyter components in one go.
Home-page: http://jupyter.org
Author: Jupyter Development Team
Author-email: jupyter#googlegroups.org
License: BSD
Location: /usr/local/lib/python2.7/site-packages
Requires: ipywidgets, nbconvert, notebook, jupyter-console, qtconsole, ipykernel
But when I run which -a jupyter I get nothing. I even tried uninstalling and installing python again via Homebrew and it still gives me the error, -bash: jupyter: command not found.
I have python installed correctly, which -a python gives:
/usr/local/bin/python
/usr/bin/python
Any ideas as to why it might not be working?
I'm on Mac and am using Zsh. For some reason, after I installed Python3, the following line:
PATH="/Library/Frameworks/Python.framework/Versions/3.6/bin:${PATH}"
was added to .zprofile instead of .zshrc.
I transferred the line to .zshrc and did source ~/.zshrc. That did the trick.
The below command seems to install only python files (under /usr/local/lib/python2.7/site-packages in your case):
pip install jupyter
You can run the jupyter as a Python's module like this:
python -m jupyter
To see all installed modules you can type the following command from the Python's shell:
help('modules')
As an alternative you can try to upgrade the package:
pip install --upgrade pip
pip install --upgrade jupyter
If you want to access the jupyter by simply typing jupyter in your shell then the path to the jupyter's binary file should be placed inside the PATH variable.
During the installation of Anaconda software the jupyter binary is placed under /usr/local/bin/jupyter (Ubuntu 14.04).
On Mac OS Mojave,
pip3 install jupyter
installs jupyter under
/Library/Frameworks/Python.framework/Versions/3.5/bin/
. Your version may be different from 3.5. You can then link to the binary there as follows.
ln -s /Library/Frameworks/Python.framework/Versions/3.5/bin/jupyter /usr/local/bin/
In the rare case that /usr/local/bin/ is not on your PATH, you may replace it above with some folder that is.
python -m notebook
should do the trick

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

Categories