Python E: 找不到包pip

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14716569/
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-18 12:14:24  来源:igfitidea点击:

E: unable to locate package pip

androidpythonubuntupip

提问by Plaix

I have been trying to set up Python-android environment, and kept getting this error message:

我一直在尝试设置 Python-android 环境,并不断收到此错误消息:

~$ sudo apt-get install build-essential patch git-core ccache ant pip python-devsudo: /var/lib/sudo/plaix writable by non-owner (040777), should be mode 0700
[sudo] password for plaix: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package pip

采纳答案by Eliah Kagan

In Ubuntu, pipis provided by the python-pippackage. You can install it in the Software Center, or, if you prefer to use the command line:

在 Ubuntu 中,pip是由python-pip包提供的。您可以在软件中心安装它,或者,如果您更喜欢使用命令行:

sudo apt-get update && sudo apt-get install python-pip

If you have not already installed python-devand build-essential, you should install them too. (But it seems your apt-getcommand mighthave successfully installed them. If you're not sure, you can check by trying to install them again. Or with apt-cache policy python-dev build-essential.)

如果您还没有安装python-devand build-essential,您也应该安装它们。(但似乎您的apt-get命令可能已成功安装它们。如果您不确定,您可以通过尝试再次安装它们来进行检查。或者使用apt-cache policy python-dev build-essential.)

Once the necessary software is installed, if you wish to update it further, you can do so with pipitself, by running:

安装必要的软件后,如果您希望进一步更新它,您可以pip通过运行以下命令对其进行更新:

sudo pip install --upgrade pip 
sudo pip install --upgrade virtualenv

Source:How to install pip on Ubuntuby Eliot(dated, but should still apply).

来源:如何在Ubuntu上安装PIP艾略特(日期,但应该仍然适用)。

回答by asermax

Python packages generally have a pythonprefix.

Python 包通常有一个python前缀。

Try installing python-pipinstead of pip(this may change depending the distribution you are working on).

尝试安装python-pip而不是pip(这可能会根据您正在使用的发行版而改变)。

回答by flathead

To install pip, download get-pip.py. Then run this command:

要安装 pip,请下载get-pip.py。然后运行这个命令:

sudo python get-pip.py

It will download and install pip from the source. To check if pip is installed, type this:

它将从源下载并安装 pip。要检查是否安装了 pip,请键入:

which pip

it will show where pip is located

它将显示 pip 所在的位置

/usr/local/bin/pip

or just type:

或只需输入:

pip

回答by Xu Jianan

Just update using:

只需更新使用:

sudo apt-get update

Your problem will be resolved.

您的问题将得到解决。

回答by shivansh shrivastava

Just Remove python-pip-whl

只需删除 python-pip-whl

sudo apt-get remove python-pip-whl

now try again it will work

现在再试一次它会起作用

回答by sahilarora

The package you want is not called pip, the name depends on the python version.

你想要的包没有叫pip,名字取决于python版本。

Python 2: sudo apt-get install python-pip

蟒蛇2: sudo apt-get install python-pip

Python 3: sudo apt install python3-pip

蟒蛇3: sudo apt install python3-pip