Python 使用 get-pip.py 时 pip 安装在哪里?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22278138/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 00:39:27  来源:igfitidea点击:

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

pythonmacospip

提问by Max

I just installed pip on OS X using the get-pip.pyscript provided by the developers. The script said it ran successfully, but I cannot execute pipfrom the command line. I guess pipis 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!

我刚刚使用开发人员提供的get-pip.py脚本在 OS X 上安装了 pip 。脚本说它运行成功,但我无法pip从命令行执行。我猜pip它不在我的路径中,但我不知道它安装在哪里,所以我无法将它添加到路径中。任何帮助将是最出色的。谢谢!

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...

回答by shad0w_wa1k3r

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

你知道你的python路径吗?如果是,则在Scripts目录下查看。

For me (Windows user), pipit is located in

对我(Windows 用户)来说,pip它位于

C:\Python27\Scripts\pip.exe

C:\Python27\Scripts\pip.exe

Correspondingly for Linux, it should be inside

对应对于Linux,应该在里面

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

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

Also, if you have Homebrewinstalled, pip installs with python:

另外,如果您已经Homebrew安装,pip 会使用 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.

而且,事实上你已经安装了 python & pip & 无法获取 pip 但可以从命令行(路径)获取 python,pip 一定是配置错误。

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

如果还是找不到,可以locate pip在Linux上使用,或者其他操作系统对应的搜索方法。另外,在你的情况下,它似乎已经在

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

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

as per the output message.

根据输出消息。

回答by Max

I've found the installation path. It is located here:

我找到了安装路径。它位于这里:

/Library/Frameworks/Python.framework/Versions/3.3/bin/pip

/Library/Frameworks/Python.framework/Versions/3.3/bin/pip

回答by Tyilo

If you can't find the path to pipyou can simply use python -m pipinstead:

如果找不到路径,pip可以简单地使用python -m pip

python -m pip install awesome_package

回答by Ben Liyanage

On linux you can use:

在 linux 上,您可以使用:

which pip 

To find the location of pip.

找到pip的位置。

回答by Nafis Ahmad

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

在这里你可以找到 pip 包的位置。, 在 linux 中

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

on mac

在 Mac 上

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

回答by Charles Clayton

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

对我来说,它在下面的目录中,我创建了一个别名,以便能够使用pip.

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

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

回答by Govind Rai

pip binary is named pip3 for python 3

pip 二进制文件为 python 3 命名为 pip3

If you are getting a message Requirement already up-to-datethat 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.

如果您收到一条消息Requirement already up-to-date,这意味着 pip 已经安装在您的系统上,并且您的路径中没有包含 pip 程序的目录,或者您没有正确调用 pip。

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:

如果您使用 bash,请输入“pi”并按两次 Tab。您将获得以 pi 开头的命令,希望您会看到 pip3。原因如下:

If you installed pipusing get-pip.pyand you installed it using a python 3 then the pipbinary is stored as pip3. Try running the command pip3instead.

如果您pip使用get-pip.py安装并使用 python 3 安装它,则pip二进制文件存储为pip3. 尝试运行该命令pip3