4

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

0

5 Answers 5

6

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.

Sign up to request clarification or add additional context in comments.

8 Comments

That's a shame, I'm using a mac system. Let me try this command and I'll get back to you.
No, unfortunately that doesn't work either: Bobbys-MBP:~ bobbyiveson$ python3 -m jupyter usage: jupyter.py [-h] [--version] [--config-dir] [--data-dir] [--runtime-dir] [--paths] [--json] [subcommand] jupyter.py: error: one of the arguments --version subcommand --config-dir --data-dir --runtime-dir --paths is required
Thanks @HackLab I understand how environment variables work but I just don't know how to find out where the jupyter file is on my system and how to add it's path to my PATH variable
But this shows that jupyter works, but of course, you need to add your arguments, I think you wanted to run notebook so python -m jupyter notebook should work.
I have tried that @HackLab and that works perfect now with the python3 -m jupyter notebook command... thank you. It also allows me to find the version of jupyter as well using python3 -m jupyter --version: giving me the output of versions for all of the components of jupyter: <code> jupyter core : 4.6.3 jupyter-notebook : 6.0.3 qtconsole : 4.7.3 ipython : 7.13.0 ipykernel : 5.2.1 jupyter client : 6.1.3 jupyter lab : not installed nbconvert : 5.6.1 ipywidgets : 7.5.1 nbformat : 5.0.5 traitlets : 4.3.3<code>
|
3

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.

Comments

2

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

Comments

1

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?

Comments

1

I definitely would recommend going through anaconda which makes everything a lot easier. The following is the link with step by step instructions: https://jupyter.readthedocs.io/en/latest/install.html

4 Comments

Hi, thanks for the reply I tried the locate command but for some reason this did not show me exactly where the jupyter command is. I managed to make it work with the jupyter-notebook command as this was in the directory /usr/local/bin which was already set to my path. Since then I have discovered that the jupyter executable is actually stored in /Users/my-home-directory/Library/Python/3.7/bin. I've added this to my $PATH variable using export PATH=$PATH:/Users/my-home-directory/Library/Python/3.7/bin in the my .bash_profile file.
Now when running jupyter it works. I've enjoyed learning the command line whilst sorting out this issue it's been very eye-opening.
Also, it's very weird as when I do run locate I seem to have jupyter, jupyter-notebook and associated files installed all over the place in different directories. When running locate it show I have jupyter files stored in site-packages directory too. Who knows why but hopefully anyone else reading this will have an easier time setting it up now.
apologies these comments were supposed to be for @VictorLuu

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.