After installing Jupyter Notebook with pip, sometimes you still can’t execute the jupyter notebook
command:
command not found: jupyter notebook
This error occurs because Python can’t find the location to the Jupyter Notebook in your PATH environment variable.
To resolve this error, you can try running Jupyter Notebook directly as follows:
~/.local/bin/jupyter-notebook
If you installed the notebook using Homebrew, then use the following command instead:
/opt/homebrew/bin/jupyter-notebook
If one of those commands worked, then you need to add the path to the bin/
folder to your PATH variable.
You can do this by running the following command:
export PATH=$PATH:~/.local/bin
# Or if you use Homebrew
export PATH=$PATH:/opt/homebrew/bin/
Then run the jupyter-notebook
again. If it works, then you can add the path to the .bashrc
or .zshrc
file to make it permanent.
If you don’t know how to edit the .bashrc
file and don’t want to find out, then you can just install the Anaconda Python platform, which will set up PATH correctly.
And that’s how you solved the error jupyter notebook
command not found. I hope this tutorial helps and happy coding!