简体   繁体   中英

Pip command not found when installing on OSX using get-pip

It appears as though pip is installing fine (it says it "Successfully installed pip-19.1.1"), but I cannot located pip on my computer afterwards. I'm running OSX 10.14.4.

I haven't used Python recently on my Mac, and I recently upgraded to Python3 for a project, which requires me to use pip as well. I had pip already installed and working, but it kept trying to use Python 2.7, so I decided to uninstall and reinstall pip with the new version of Python. I've gone through a few tutorials to try and install pip. Most recently, I've tried the method recommended here: https://ahmadawais.com/install-pip-macos-os-x-python/ , which has me run:

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py

This appears to work just fine:

Collecting pip
  Downloading https://files.pythonhosted.org/packages/5c/e0/be401c003291b56efc55aeba6a80ab790d3d4cece2778288d65323009420/pip-19.1.1-py2.py3-none-any.whl (1.4MB)
     |████████████████████████████████| 1.4MB 706kB/s 
Installing collected packages: pip
  Found existing installation: pip 19.1.1
    Uninstalling pip-19.1.1:
      Successfully uninstalled pip-19.1.1
Successfully installed pip-19.1.1

However, attempting to use pip after this results in "command not found". I realize that the likely issue is that it's just not in my PATH, but I don't know how to locate it to add it to my path.

Please let me know if there's anything else that would be useful to diagnosing this. I'm pretty new to working with these tools, so I might just be missing something obvious.

You can either try:

pip3 install package-name

or you can add the locate the pip, and add if not already added into your path:

locate pip3

/usr/bin/pip3
/usr/bin/pip3.6
/usr/local/bin/pip3
/usr/local/bin/pip3.7
/usr/share/bash-completion/completions/pip3
/usr/share/bash-completion/completions/pip3.6
/usr/share/man/man1/pip3.1.gz
/usr/share/ruby/vendor_ruby/puppet/provider/package/pip3.rb

Then select the right one for your use. Generally for the fresh install (python 3), you should do (see this post):

pip3 install package-name

You can check the version using:

pip3 --version

Check this question if you have further issues.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM