[ubuntu] After installing with pip, "jupyter: command not found"

After installing with pip install jupyter, terminal still cannot find jupyter notebook.

Ubuntu simply says command not found. Similar with ipython. Did pip not get install properly or something? How does Ubuntu know where to look for executables installed with pip?

This question is related to ubuntu pip jupyter-notebook jupyter

The answer is


you did not log out and log in ? It should be on your path to execute. If not, pip installed executables in .local, so in a terminal:

 ~/.local/bin/jupyter-notebook

should start notebook


On Mac OS you need to export ~/.local/bin inside your $PATH variable.

# Edit the bash profile:
$ vim ~/.bash_profile

# Add this line inside ~/.bash_profile:
export PATH=$PATH:~/.local/bin

# Update the source:
$ source ~/.bash_profile

# Open Jupyter:
$ jupyter notebook

Anyone looking for running jupyter as sudo, when jupyter installed with virtualenv (without sudo) - this worked for me:

First verify this is a PATH issue:

Check if the path returned by which jupyter is covered by the sudo user:

sudo env | grep ^PATH

(As opposed to the current user: env | grep ^PATH)

If its not covered - add a soft link from it to one of the covered paths. For ex:

sudo ln -s /home/user/venv/bin/jupyter /usr/local/bin

Now you sould be able to run:

sudo jupyter notebook

  • Open a terminal window using Ctrl+Alt+T.

  • Run the command gedit ~/.profile.

  • Add the line. export PATH=$PATH:/.local/bin/jupyter-notebook. to the bottom and save.

  • Log out and log in again.

Hopefully this will work.


I had to run "rehash" and then it was able to find the jupyter command


To be able to run jupyter notebook from terminal, you need to make sure that ~/.local/bin is in your path.

Do this by running export PATH=$PATH:~/.local/bin for your current session, or adding that line to the end of ~/.bashrc to make your changes last for future sessions (e.g. by using nano ~/.bashrc). If you edit ~/.bashrc you will need to log out and log back in to make see your changes take effect.


Try "pip3 install jupyter", instead of pip. It worked for me.


I compiled python3.7 from the source code, with the following command

./configure --prefix=/opt/python3.7.4 --with-ssl
make
make install

after pip3.7 install jupyter I found the executable is under /opt/python3.7.4/bin

check my answer here Missing sqlite3 after Python3 compile to get more detail comping python3.7 and pip under ubuntu14.04


The only thing that worked me is to export to PATH the Python version that is related to the pip3 of course :) (after a lot of struggling) just run:

which pip3

you should get something like (in Mac):

/Library/Frameworks/Python.framework/Versions/3.6/bin/pip3

Now run:

export PATH=/Library/Python/3.6/bin:$PATH

If it works for you :) just add it to your bashrc or zshrc


I tried both,

pip install jupyter

and

pip3 install jupyter

but finally got it done using

sudo -H pip install jupyter

execute a command as another user -H

The -H (HOME) option requests that the security policy set the HOME environment variable to the home directory of the target user (root by default) as specified by the password database. Depending on the policy, this may be the default behavior.


Try

python -m notebook

Or, if you used pip3 to install the notebook:

python3 -m notebook

On Mac OS Catalina and brewed Python3.7


Execute this in Terminal

export PATH=~/anaconda3/bin:$PATH

Worked for me on Ubuntu 16.10, Python3, Anaconda3

UPDATE

Add path in your ~/.bashrc or ~/.zshrc(if you are using zsh bash) file

vi ~/.bashrc

add the below line to the file

PATH=~/path/to/anaconda:$PATH

Close the file with

esc + : + wq

On Mac Os High Sierra, I installed jupyter with

python3 -m pip install jupyter    

And then, binary were installed in:

/Library/Frameworks/Python.framework/Versions/3.6/bin/jupyter-notebook

if you are in a virtual environment, just run this:

conda install jupyter


After installation of Jupyter Notebook on Ubuntu I got below error:

Exception: Jupyter command 'jupyter-notebook' not found.

I used simple command it's working for me

pip install --upgrade --force-reinstall --no-cache-dir jupyter

Source: http://commandstech.com/how-to-install-jupyter-on-ubuntu16-04-with-pictures-commands-errors-solution/

After exit from root user then execute :

jupyter notebook


Most generally (in case of jupyter not being in /local/bin) use,

which jupyter

Example output

~/miniconda3/bin/jupyter

to see the path for jupyter, then explicitly use that path with sudo

sudo ~/miniconda3/bin/jupyter 

pip install --user --upgrade jupyter

Using the above command should do the job in Ubuntu 18.04

If it doesn't, follow the steps from here


Now in the year of 2020. fix this issue by my side with mac: pip install jupyterlab instead pip install jupyter. there will be an warning before successfully installed keywords: enter image description here

you can see the path with jupyterlab then you just need to start jupyter notebook by following in path:

jupyter-lab

notebook will automatic loaded by your default browser.


Install jupyterlab.

If you get this error:

ERROR: After October 2020 you may experience errors when installing or updating packages. This is because pip will change the way that it resolves dependency conflicts.

We recommend you use --use-feature=2020-resolver to test your packages with the new resolver before it becomes the default.

requests 2.25.1 requires idna<3,>=2.5, but you'll have idna 3.1 which is incompatible.

Use this:

pip3 install jupyterlab --use-feature=2020-resolver

Once you run pip install jupyter. Make sure you restart the terminal so it would update environment and home variable. This worked for me


If jupyter run by this command:

~/.local/bin/jupyter-notebook

simply run this command in terminal

 export PATH=~/.local/bin:$PATH

Here is how it worked for me The PATH for jupyter after installing it using pip is located

which pip

/usr/local/bin

so to run the jupyter notebook i just typed in my terminal:

jupyter-notebook

and it worked for me am using parrot os and installed jupyter using pip3


Here what I did on Linux mint 19:

I installed jupyter with:

pip install jupyter

and command:

jupyter notebook

didn't work, so with:

sudo apt install jupyter-notebook

I fixed the issue, jupyter notebook worked then.


For my case, jupyter-notebook <name of the notebook> worked


I'm on Mojave with Python 2.7 and after pip install --user jupyter the binary went here:

/Users/me/Library/Python//2.7/bin/jupyter

If you installed Jupyter notebook for Python 2 using 'pip' instead of 'pip3' it might work to run:

ipython notebook

Examples related to ubuntu

grep's at sign caught as whitespace "E: Unable to locate package python-pip" on Ubuntu 18.04 How to Install pip for python 3.7 on Ubuntu 18? "Repository does not have a release file" error ping: google.com: Temporary failure in name resolution How to install JDK 11 under Ubuntu? How to upgrade Python version to 3.7? Issue in installing php7.2-mcrypt Install Qt on Ubuntu Failed to start mongod.service: Unit mongod.service not found

Examples related to pip

How to fix error "ERROR: Command errored out with exit status 1: python." when trying to install django-heroku using pip "E: Unable to locate package python-pip" on Ubuntu 18.04 How to Install pip for python 3.7 on Ubuntu 18? What is the meaning of "Failed building wheel for X" in pip install? Could not install packages due to an EnvironmentError: [Errno 13] How do I install Python packages in Google's Colab? Conda version pip install -r requirements.txt --target ./lib pip: no module named _internal AttributeError: Module Pip has no attribute 'main' Error after upgrading pip: cannot import name 'main'

Examples related to jupyter-notebook

How to prevent Google Colab from disconnecting? Jupyter Notebook not saving: '_xsrf' argument missing from post How do I install Python packages in Google's Colab? What is the difference between Jupyter Notebook and JupyterLab? Importing .py files in Google Colab Display all dataframe columns in a Jupyter Python Notebook How to open local file on Jupyter? how to open Jupyter notebook in chrome on windows Change the Theme in Jupyter Notebook? Jupyter notebook not running code. Stuck on In [*]

Examples related to jupyter

How to increase image size of pandas.DataFrame.plot in jupyter notebook? What is the difference between Jupyter Notebook and JupyterLab? Removing Conda environment How to open local file on Jupyter? Jupyter notebook not running code. Stuck on In [*] Can I run Keras model on gpu? IOPub data rate exceeded in Jupyter notebook (when viewing image) How to execute a * .PY file from a * .IPYNB file on the Jupyter notebook? how to make a new line in a jupyter markdown cell Running Jupyter via command line on Windows