可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
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
?
回答1:
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
回答2:
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.
回答3:
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
回答4:
I tried both,
pip install jupyter
and
pip3 install jupyter
but finally got it done using
sudo -H pip install jupyter
回答5:
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.
回答6:
Try "pip3 install jupyter", instead of pip. It worked for me.
回答7:
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
回答8:
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
回答9:
If jupyter run by this command:
~/.local/bin/jupyter-notebook
simply run this command in terminal
export PATH=~/.local/bin:$PATH
回答10:
If you installed Jupyter notebook for Python 2 using 'pip' instead of 'pip3' it might work to run:
ipython notebook
回答11:
I had to run "rehash" and then it was able to find the jupyter command
回答12:
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
回答13:
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
回答14:
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