0

I'm on a Mac M1 Max running OS 12.5 and Python 3.10.4. I run pip3 install jupyter and the installation went fine but I get the warnings

WARNING: The script jupyter-console is installed in '/Users/userXYZ/Library/Python/3.10/bin' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

Apparently I need to add /Users/userXYZ/Library/Python/3.10/bin to the PATH.

Update (after following the comment by @csgeek)

Following this, in the python console I run

import sys
sys.path.insert(0,'/Users/userXYZ/Library/Python/3.10/bin')

The command run without visible output or errors, but when I type jupyter-lab in the terminal I get command not found. On the other hand, invoking the full path works:

/Users/userXYZ/Library/Python/3.10/bin/jupyter-lab

Hence my questions:

  1. How do I add to the PATH?
  2. How do I check the contents of the PATH to see if it is updated?
  3. I am running from an account without administrative privileges. Does this make a difference?
wjandrea
  • 28,235
  • 9
  • 60
  • 81
  • Check if python is installed on your mac, and make sure you are running the `import sys` command in python console. – csgeek Aug 17 '22 at 04:14
  • @csgeek My mistake was running `import sys` on the terminal console. I run the commands on the console and they were executed silently. Still, running `jupyter-lab` gives command not found. On the other hand I can run jupyter if I use `/Users/userXYZ/Library/Python/3.10/bin/jupyter-lab`. Apparently I am missing something. –  Aug 18 '22 at 12:33
  • I don't use Mac, but this looks correct: [Right way to add paths to PATH in mojave - Ask Different](https://apple.stackexchange.com/q/358687/282701). (I found a bunch of other pages too, including some existing questions here on SO, but they left out crucial info for a beginner.) – wjandrea Aug 18 '22 at 22:19

1 Answers1

0

First, I should say that since my original question I reinstalled jupyter, this time using homebrew. I am on zsh, so I created the file .zshrc and added the line

export PATH="$PATH:/opt/homebrew/bin"

'echo $PATH` now shows

/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/homebrew/bin

and jupyter notebook runs as expected.

For bash shell I suppose the process is as described in the link by @wjandrea