After installing with pip, "jupyter: command not found"
Asked Answered
F

32

331

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?

Formidable answered 10/2, 2016 at 11:25 Comment(7)
Possible duplicate of Jupyter notebook command does not work on MacRiboflavin
This is not only Mac related. In both systems, my proposal solves the case.Riboflavin
seems like this should be here unix.stackexchange.com/questions/tagged/ubuntuWreckage
great question. so many answers and none of them work for me when using brew on high sierraKyanize
Also just a minor note: I needed the "--user" flag when installing, so python3 -m pip install --user jupyter worked for meSelfregard
Related Windows question: #41035366Collude
Ran into the same issue. We can use python3 -m jupyterlab as a quick way to get it running.Doretha
L
253

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

Lapotin answered 10/2, 2016 at 14:57 Comment(6)
pip does not put jupyter on your path. This is a blunder in the docs for jupyter installation.Jannery
Hi, this works for me, but I would like to understand why. I used sudo to pip install jupyter, shouldnt it be a system-wide install ?Shanon
@DeanSchulze, hey then how does one install it?Capri
I wonder this is not a solution. One should be able type "jupyter" command. emunsing has a better, complete aswer.Prussian
Is there any tip for running it on WSL Debian? I tried all the advices on this post, no avail.Gilgamesh
Still says command not found. Something just destroyed my working jupyter installation. I think pip destroyed it. This is ubuntu os, the most popular linux IIRC. It is for a coursera course which gave me the commands it needed to install course requirements for software libs.Harshman
L
284

Try

python -m notebook

Or, if you used pip3 to install the notebook:

python3 -m notebook

On Mac OS Catalina and brewed Python3.7

Ledet answered 2/1, 2020 at 23:27 Comment(4)
I have Mas OS Catalina, and yes this solution have worked for me ! But I don't know why the command jupyter notebook doesn't work anymore ?Miranda
The only one worked for me for python3.6 on Ubuntu (but of course I ran python3.6 -m notebook instead), That's because I installed Jupyter using pip3.6 (which I wanted).Dyanna
This works but it just shows the plain notebook view, not the jupyter lab viewCawley
I tried executing the 'python3 -m notebook' syntax and it worked for me. I have installed the jupyter notebook without installing anaconda on my M2 chip Macbook Air. I'm now able to use the notebook with Visual Studio Code without doing any update to the $PATH variable etc.Noddy
L
253

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

Lapotin answered 10/2, 2016 at 14:57 Comment(6)
pip does not put jupyter on your path. This is a blunder in the docs for jupyter installation.Jannery
Hi, this works for me, but I would like to understand why. I used sudo to pip install jupyter, shouldnt it be a system-wide install ?Shanon
@DeanSchulze, hey then how does one install it?Capri
I wonder this is not a solution. One should be able type "jupyter" command. emunsing has a better, complete aswer.Prussian
Is there any tip for running it on WSL Debian? I tried all the advices on this post, no avail.Gilgamesh
Still says command not found. Something just destroyed my working jupyter installation. I think pip destroyed it. This is ubuntu os, the most popular linux IIRC. It is for a coursera course which gave me the commands it needed to install course requirements for software libs.Harshman
U
168

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.

Ununa answered 8/7, 2016 at 0:40 Comment(2)
For changes to made to ~/.bashrc, there is no need to log out and then back in. Just do source ~/.bashrc and that will suffice.Cropeared
For those using zsh, you can update ~/.zshrc and then source ~/.zshrcRecoil
V
88

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.

Ventriloquist answered 8/12, 2017 at 21:19 Comment(3)
This worked for me on macOS High Sierra running in a virtual envOriana
I ran into issues later by using SUDO with pip. Generally you shouldn't do this.Hooligan
@TomAranda ... but that assumes that you know what's going on in your environment. That's often not the case. This is simply list of commands that might work for some people with no guarantees what it breaks. I am sure that if OP understand all the implications and what was the problem in first place, they would explain. I still find those snippets helpful even though it's not the exact answer to the problem. It's complicated world of package dependencies, sometimes it's just not worth to understand exactly what's going on. Unless it's a lunar orbit software.Divest
S
42

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
Sudden answered 14/3, 2017 at 14:57 Comment(2)
this worked for me! I did install anaconda beforehandBenighted
Please read again the question. I have described the anaconda install scenario, but the question is related to the pip. >After installing with pip install jupyterPrussian
G
15

If jupyter run by this command:

~/.local/bin/jupyter-notebook

simply run this command in terminal

 export PATH=~/.local/bin:$PATH
Gavrah answered 24/5, 2018 at 20:47 Comment(0)
D
15

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
Dissident answered 20/7, 2018 at 16:36 Comment(0)
L
15

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

Levitus answered 7/10, 2019 at 6:58 Comment(2)
That worked in my mac too. I spent 3 hours trying to figure this out and none of the solutions worked for me. Thanks!Microwave
This works for me too! My problem was that pip3 install jupyter did not even install ~/.local/bin/jupyter-notebook. After running your solution, that fixed this problem!Ithaman
P
14

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
Periodicity answered 22/4, 2018 at 20:9 Comment(0)
C
8
  • 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.

Case answered 27/6, 2017 at 15:47 Comment(0)
G
7

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.

Graveyard answered 10/6, 2020 at 14:6 Comment(0)
G
6

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

Gurias answered 25/1, 2017 at 8:12 Comment(0)
S
6

python3 -m jupyterlab worked for me!

For me, it's after pip install jupyterlab, can't use jupyter-lab in command line directly. but python3 -m jupyterlab worked.

Spelaean answered 26/3, 2023 at 7:16 Comment(0)
S
5

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.

Shiner answered 28/8, 2020 at 9:41 Comment(0)
M
4

I tried everything and at the end this worked for me on Raspberry pi 4 running Raspbian os

sudo apt install python3-notebook jupyter jupyter-core
Mesh answered 3/2, 2022 at 22:20 Comment(0)
J
3

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

Jejunum answered 28/10, 2018 at 17:17 Comment(0)
P
2

I see this error in 2023 and pip install jupyter and set env path doesn't really help. I solved this by running pip install notebook as well.

Because I see in jupyter --version command that shows notebook is not installed.

I made a guess of the required package name and it just worked for me:)

Prelect answered 5/3, 2023 at 8:15 Comment(0)
E
2

jupyter and jupyter-notebook are two different things. you install notebook with

pip install notebook

and start a notebook with

jupyter-notebook

you install jupyter with

sudo snap install jupyter

Most likely users who installed noteebok want to start with jupyter command. But its command is jupyter-notebook

What is the difference between jupyter and jupyter-notebook

Elinorelinore answered 2/9, 2023 at 18:9 Comment(0)
P
1

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

ipython notebook
Pelfrey answered 5/2, 2018 at 7:57 Comment(0)
K
1

Re-install jupyter with conda:

conda install jupyter
Khachaturian answered 26/3, 2022 at 2:35 Comment(1)
Your answer could be improved by adding more information on what the command does and how it helps the OP.Shult
A
1

Newer Jupyter versions do not come with notebook component by default.

Depending on your package manager, you can install notebook component by:

pip install notebook

or

poetry add notebook
Alidis answered 23/9, 2022 at 11:12 Comment(0)
M
0

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 
Miquelmiquela answered 10/1, 2019 at 17:19 Comment(0)
N
0

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

Nilsson answered 13/8, 2019 at 14:48 Comment(0)
S
0

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
Speculation answered 6/10, 2019 at 9:57 Comment(0)
I
0

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
Isooctane answered 7/2, 2021 at 16:24 Comment(2)
It led to no such option: --use-featureLepidopteran
Hmm, probably they've changes something with new version releases. Try running it without --use-feature=2020-resolver and see if it works.Isooctane
D
0

On MacOs, this worked for me:

/Users/`userName`/opt/anaconda3/bin/jupyter_mac.command
Demagoguery answered 22/11, 2021 at 13:21 Comment(0)
S
0

For me, it didn't work until I activated Virtual Environment.

Shoebill answered 29/5, 2022 at 13:52 Comment(0)
S
0

I reinstalled it with

python3 -m pip install jupyter 

Then found it with

which jupyter

under

/Users/username/.pyenv/versions/miniforge3-4.10.3-10/bin/jupyter
Semeiology answered 10/5, 2023 at 13:14 Comment(1)
python3 -m notebook worked forMyrmeco
R
0

pypi.org has two different packages for jupyter and notebook. On Mac, if you installed the jupyter metapackage (pip install jupyter, contraty to pip install notebook) then the command jupyter-notebook seems to work while jupyter notebook does not.

Regeneration answered 25/6, 2023 at 15:55 Comment(0)
P
0

If the installation was successful, just restart your virtual machine (Mine was Oracle). Then open your terminal, type - Jupyter Notebook - and hit enter. I will ask your password for the first time launhing. Enter your password and hit unlock. Now you can launch it only typing Jupyter notebook on your terminal. Once it is unlocked, you don't have to enter your password every single time.

Proxy answered 31/7, 2023 at 22:35 Comment(0)
R
0

If you use anaconda, just do:

conda install jupyter notebook

Racism answered 16/1 at 12:55 Comment(0)
L
0

None of the above works for me. It seems that some legacy jupyter_* packages are incompatible. So:

  1. pip uninstall notebook
  2. pip uninstall -y $(pip freeze | grep -E '^jupyter.*' | cut -d '=' -f 1)
  3. pip install notebook
Lawannalawbreaker answered 29/2 at 22:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.