8

I recently installed Jupyter Notebook on my Linux machine (which has Python 3.6 installed) according to their instructions:

python3 -m pip install --upgrade pip
python3 -m pip install jupyter

However, when I run

jupyter notebook

I get the following error:

Error executing Jupyter command 'notebook': [Errno 2] No such file or directory

If I run:

cd /usr/bin
ls -l | grep jupyter

The results are:

-rwxr-xr-x 1 root root         397 Feb 20 00:29 jupyter
-rwxr-xr-x 1 root root         413 Feb 20 00:29 jupyter-migrate
-rwxr-xr-x 1 root root         423 Feb 20 00:29 jupyter-troubleshoot

There doesn't seem to be a 'notebook' script in there.

python3 -m pip list includes notebook 5.5.0 in its output.

Other answers suggest installing Anaconda, but I'd like to avoid that for now. I'm just curious why it isn't working, since the installation instructions were very brief and clear.

I'm more looking to understand the problem, rather than for a quick fix. Thanks!

Edit: jupyter notebook now seems to work properly after another restart + reinstall. Thanks for the help.

2
  • Looks like you're missing the notebook package - can you run python3 -m pip list and add the output to the question? Commented May 20, 2018 at 19:10
  • Hmm, the output includes notebook 5.5.0. Question edited Commented May 20, 2018 at 19:51

4 Answers 4

19

Something went wrong with your installation.

If you want to use pip please try:

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

If this doesn't work please install Jupyter using this command:

sudo apt install jupyter-notebook
Sign up to request clarification or add additional context in comments.

8 Comments

I believe your first suggestion is what fixed it, though I am not 100% sure. I did not use the --force-reinstall option.
Do not use pip to upgrade pip on ubuntu, it could break pip. The part that made it work was sudo apt install jupyter-notebook.
Hi @ThisGuyCantEven... What do you mean by saying do not use pip to upgrade pip on Ubuntu? I never suggested that...
I used your answer in an attempt to solve this problem and it broke pip on my machine, this is a known issue and the folks at pip are working on it. Lots of Info here. If you run python3 -m pip install --upgrade pip and and it breaks your pip, the solution is to downgrade back to pip 9.0.1
python3 -m pip uninstall pip sudo apt-get --reinstall install python3-pip
|
3

can you test if it will run with

python -m notebook

also i search why it is happened

1 Comment

Additional deets on '-m' option by typing "man python" into terminal.
0

Assuming you are interested in python 3 on Ubuntu (Tested on Kali Linux too)

  1. installing pip and python-dev will help you to download Python-specific packages.

$ sudo apt-get -y install python3-pip

$ sudo apt-get -y install python3-dev

  1. upgraded pip to the latest version.

$ sudo -H pip3 install --upgrade pip

  1. install Jupyter

$ sudo -H pip3 install jupyter OR sudo apt install jupyter-notebook

  1. Create a config file for Jupyter

$ jupyter notebook --generate-config

  1. Add two lines below to the newly created config file that will make you able to use your Jupyter notebook from a browser window (you can use nano or vim to add manually.

$ echo "c.NotebookApp.ip = '*'" >> /home/[your_username]/.jupyter/jupyter_notebook_config.py

$ echo "c.NotebookApp.allow_remote_access = True" >> /home/[your_username]/.jupyter/jupyter_notebook_config.py

  1. Test Jupyter by typing

$ jupyter notebook --browser

This command will start to run the Jupyter application on your server or local machine.

While it’s running in Terminal, just open a browser and type in localhost or server ip followed by :8888 e.g

if you are running it on a server, use server's ip like so 192.x.x.x:8888 on your browser (any machine anywhere)

if you are running it on a PC then type localhost:8888 on your browser (limited within your PC running jupyter)

hope this helps

Comments

0

You might try by typing in command window (as showing in image)

py -m notebook

enter image description here

Hope it works.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.