pip3 install of Jupyter and Notebook problem when running

Viewed 1892

I have tried all of the things here on stack and on other sites with no joy...

I'd appreciate any suggestions please.

I have installed Jupyter and Notebook using pip3 - please note that I have updated pip3 before doing so.

However when trying to check the version of both jupyter --version and notebook --version my terminal is returning no command found. I have also tried to run jupyter, notebook and jupyter notebook and I am still getting the same message.

I have spent nearly two days now trying to sort this out... I'm on the verge of giving up.

I have a feeling it has something to do with my PATH variable maybe not pointing to where the jupyter executable is stored but I don't know how to find out where notebook and jupyter are stored on my system.

many thanks in advance

Bobby

5 Answers

You should be able to run jupyter with python -m even if the PATH variable is not set up correctly.

python -m jupyter notebook

you can check the PATH variables on Windows if you search in with the windows search function for env and then click on Edit the system environment variables > Environment Variables.... The path variable is a list of paths that the terminal checks for commands.

I didn`t work on Mac for a long time, so not sure how similar linux and mac command line still are, but on debian you control your path variable like this. View paths:

echo $PATH
/usr/local/bin:/usr/bin:/bin

Add a path:

export PATH=$PATH:/mynewpath

For constant export add to ~/.bashrc

To view the path of the pip package, you can use

pip3 show jupyter

When jupyter-notebook works and jupyter notebook does not. It looks to me like a symlink thing. Or a Mac-specific problem.

So to summarise this is what I have found on this issue (in my experience):

to run the jupyter app you can use the jupyter-notebook command and this works, but why? This is because, the jupyter-notebook is stored in usr/local/bin which is normally always stored in the PATH variable.

I then discovered that the jupyter notebook or jupyter --version command will now work if I did the following:

  1. open my ./bash_profile file
  2. add the following to the bottom of the file: export PATH=$PATH:/Users/your-home-directory/Library/Python/3.7/bin

this should add the location of where jupyter is located to your path variable.

Alternatively, as suggested by @HackLab we can also do the following:

  • python3 -m jupyter notebook

Hopefully, this will give anyone else having the same issues I had an easier time resolving this issue.

I've found a solution from the documentation over at Jupyter https://jupyter-notebook.readthedocs.io/en/stable/troubleshooting.html but I am still curious.

It states that to run the application to use the command jupyter-notebook and hey-presto! It does seem to work now. But, why is this when nearly everywhere else I have read that to run the app we just type the command jupyter notebook.

Also, if I do need to check the version of any of the Jupyter files how do I go about this now, if jupyter --version and notebook --version still don't work.

Also, how do I go about finding these files in my file system if I have no idea where they are located? And how do I go about adding these to my path so that I can, for example, check the version of these programs?

Will pip3 automatically update this software as and when needed?

Thanks again in advance

have you tried locate Jupiter? It may tell you where jupyter is on your system. Also, why not try installing jupyter via anaconda to avoid the hassle?

Related