E: unable to locate package pip

2020-05-23 08:12发布

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

~$ 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

6条回答
劳资没心,怎么记你
2楼-- · 2020-05-23 08:50

Just Remove python-pip-whl

sudo apt-get remove python-pip-whl

now try again it will work

查看更多
Emotional °昔
3楼-- · 2020-05-23 08:51

Just update using:

sudo apt-get update

Your problem will be resolved.

查看更多
爷、活的狠高调
4楼-- · 2020-05-23 08:54

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

sudo python get-pip.py

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

which pip

it will show where pip is located

/usr/local/bin/pip

or just type:

pip
查看更多
相关推荐>>
5楼-- · 2020-05-23 09:01

Python packages generally have a python prefix.

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

查看更多
虎瘦雄心在
6楼-- · 2020-05-23 09:05

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

Python 2: sudo apt-get install python-pip

Python 3: sudo apt install python3-pip

查看更多
聊天终结者
7楼-- · 2020-05-23 09:12

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

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

If you have not already installed python-dev and build-essential, you should install them too. (But it seems your apt-get command might have 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.)

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

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

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

查看更多
登录 后发表回答