Error when executing `jupyter notebook` (No such file or directory)

Python 3.xJupyter Notebook

Python 3.x Problem Overview


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?

Python 3.x Solutions


Solution 1 - Python 3.x

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.

Solution 2 - Python 3.x

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

Solution 3 - Python 3.x

Try this command: python -m IPython notebook

Credits to the GitHub user Milannju who provided the solution here.

Solution 4 - Python 3.x

This worked for me. (Python 3.6 on Ubuntu 18.04 LTS)

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

Solution 5 - Python 3.x

On Ubuntu 18.10, the following command helped me out.

sudo apt-get install jupyter-notebook

Solution 6 - Python 3.x

Jupyter installation is not working on Mac Os

To run the jupyter notebook:-> python -m notebook

Solution 7 - Python 3.x

Use the command below and if you are using pip3 replace pip by pip3

pip install --upgrade --force-reinstall jupyter

This worked for me.

Solution 8 - Python 3.x

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.

Solution 9 - Python 3.x

Deactivate your virtual environment if you are currently in;

Run following commands:

python -m pip install jupyter

jupyter notebook

Solution 10 - Python 3.x

For me the fix was simply running pip install notebook

Somehow the original Jupiter install got borked along the way.

Solution 11 - Python 3.x

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.

Solution 12 - Python 3.x

If you are on Fedora installing python3-notebook resolved my problem.

# dnf install python3-notebook

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionDavid ChenView Question on Stackoverflow
Solution 1 - Python 3.xLouise DaviesView Answer on Stackoverflow
Solution 2 - Python 3.xNic ScozzaroView Answer on Stackoverflow
Solution 3 - Python 3.xsiddharthrcView Answer on Stackoverflow
Solution 4 - Python 3.xThayakorn RakwetpakornView Answer on Stackoverflow
Solution 5 - Python 3.xpritish thakkarView Answer on Stackoverflow
Solution 6 - Python 3.xJaved GouriView Answer on Stackoverflow
Solution 7 - Python 3.xrahulView Answer on Stackoverflow
Solution 8 - Python 3.xDeepak SoodView Answer on Stackoverflow
Solution 9 - Python 3.xShu ZhangView Answer on Stackoverflow
Solution 10 - Python 3.xChrisView Answer on Stackoverflow
Solution 11 - Python 3.xLars EricsonView Answer on Stackoverflow
Solution 12 - Python 3.xanonView Answer on Stackoverflow