Where is pip installed to when using get-pip.py?

2019-03-09 09:29发布

I just installed pip on OS X using the get-pip.py script provided by the developers. The script said it ran successfully, but I cannot execute pip from the command line. I guess pip is not in my path, but I don't know where it installed to so I can't add it to the path. Any help would be most excellent. Thanks!

When I attempt to run the install script again, here is the output:

Requirement already up-to-date: pip in /Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages
Cleaning up...

标签: python macos pip
7条回答
对你真心纯属浪费
2楼-- · 2019-03-09 09:39

For me, it was in the directory below and I created an alias to just be able to run it with pip.

alias pip='python /lnx510/home/<username>/.local/lib/python2.6/site-packages/pip'

查看更多
趁早两清
3楼-- · 2019-03-09 09:49

If you can't find the path to pip you can simply use python -m pip instead:

python -m pip install awesome_package
查看更多
祖国的老花朵
4楼-- · 2019-03-09 09:50

On linux you can use:

which pip 

To find the location of pip.

查看更多
Melony?
5楼-- · 2019-03-09 09:51

Do you know your python path? If yes, then look under the Scripts directory.

For me (Windows user), pip it is located in

C:\Python27\Scripts\pip.exe

Correspondingly for Linux, it should be inside

/usr/lib/python2.7/dist-packages/pip

Also, if you have Homebrew installed, pip installs with python:

brew install python

And, the fact that you have python & pip installed & cannot get pip but can get python from the command line (path), pip must have been misconfigured.

If you still can't find it, you can use locate pip for Linux, or a corresponding search method for other OSs. Also, in your case, it already seems to be in

/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages

as per the output message.

查看更多
狗以群分
6楼-- · 2019-03-09 09:52

here you can find where the pip packages are., In linux

/usr/lib/python2.7/site-packages

on mac

/usr/local/lib/python2.7/site-packages/
查看更多
别忘想泡老子
7楼-- · 2019-03-09 09:56

pip binary is named pip3 for python 3

If you are getting a message Requirement already up-to-date that means pip is already installed on your system and you either don't have the directory which contains the pip program in your path or you are not calling pip correctly.

If you are using bash, type "pi" and hit tab twice. You will get commands starting with pi and hopefully you will see pip3. Here's why:

If you installed pip using get-pip.py and you installed it using a python 3 then the pip binary is stored as pip3. Try running the command pip3 instead.

查看更多
登录 后发表回答