0

I just installed Python 3.7 from python.org. I followed this StackOverflow post to change my default Python to Python 3. From there I ran the Update Shell Profile.command and Install Certificates.command (Finder > Applications > Python 3.7).

Then I found that I couldn't run the pip command

> $ pip --version

> -bash: pip: command not found

Subsequently I ran the following 2 commands..

> $ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
> 
> $ python get-pip.py
Collecting pip
  Downloading https://files.pythonhosted.org/packages/5f/25/e52d3f31441505a5f3af41213346e5b6c221c9e086a166f3703d2ddaf940/pip-18.0-py2.py3-none-any.whl (1.3MB)
    100% |████████████████████████████████| 1.3MB 5.5MB/s 
Collecting wheel
  Downloading https://files.pythonhosted.org/packages/81/30/e935244ca6165187ae8be876b6316ae201b71485538ffac1d718843025a9/wheel-0.31.1-py2.py3-none-any.whl (41kB)
    100% |████████████████████████████████| 51kB 12.1MB/s 
Installing collected packages: pip, wheel
Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/pip'
Consider using the `--user` option or check the permissions.

Then I added the --user flag

> $ python get-pip.py --user
> 
> Collecting pip   Using cached
> https://files.pythonhosted.org/packages/5f/25/e52d3f31441505a5f3af41213346e5b6c221c9e086a166f3703d2ddaf940/pip-18.0-py2.py3-none-any.whl
> Collecting wheel   Using cached
> https://files.pythonhosted.org/packages/81/30/e935244ca6165187ae8be876b6316ae201b71485538ffac1d718843025a9/wheel-0.31.1-py2.py3-none-any.whl
> Installing collected packages: pip, wheel  

This is what I don't understand

> The script wheel is
> installed in '/Users/kevinturney/Library/Python/2.7/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.

What is the wheel and how do I add this to the correct path?

> $ which python

> /usr/local/opt/python/libexec/bin/python

What is the wheel and how do I add this to the correct path?

rdimaio
  • 325
  • 2
  • 3
  • 15
Kevin T.
  • 668
  • 3
  • 12
  • 29
  • This indicates that the location of `pip` is not considered when you enter `pip` on the commandline. Instead changing this path you can try `python -m pip --version` for example. This should achieve the same as `pip --version`. – rocksportrocker Sep 27 '18 at 15:29
  • I ran that and got .. pip 18.0 from /usr/local/lib/python3.7/site-packages/pip (python 3.7) What about the script wheel? Which directory do they want me to add? – Kevin T. Sep 27 '18 at 15:44
  • you should extend the environment variable `PATH` with `'/Users/kevinturney/Library/Python/2.7/bin'`, see also https://stackoverflow.com/questions/14637979/how-to-permanently-set-path-on-linux-unix or https://askubuntu.com/questions/60218/how-to-add-a-directory-to-the-path – rocksportrocker Sep 27 '18 at 15:51
  • Even though I my path for python 3 ($ which python) is /usr/local/opt/python/libexec/bin/python? I'm confused, do I add it to this path or to the one above .../usr/local/lib/python3.7/site-packages/pip (python 3.7). In my .bash_profile at the bottom I have .. PATH="/Library/Frameworks/Python.framework/Versions/3.7/bin:${PATH}" – Kevin T. Sep 27 '18 at 15:55
  • Yes, but the "--user" flag allows installation to a local folder where you have write access. So just extend your PATH manipulation with the given path. – rocksportrocker Sep 28 '18 at 14:02

0 Answers0