How to fix command not found: jupyter notebook


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!

Take your skills to the next level ⚡️

I'm sending out an occasional email with the latest tutorials on programming, web development, and statistics. Drop your email in the box below and I'll send new stuff straight into your inbox!

No spam. Unsubscribe anytime.