Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

E: unable to locate package pip

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
like image 240
Plaix Avatar asked Feb 05 '13 20:02

Plaix


People also ask

How do I fix Python unable to locate a package?

Start by updating the package list using the following command: sudo apt update. Use the following command to install pip for Python 3: sudo apt install python3-pip. Once the installation is complete, verify the installation by checking the pip version: pip3 –version.

How do I fix pip not found?

A “pip: command not found” error occurs when you fail to properly install the package installer for Python (pip) needed to run Python on your computer. To fix it, you will either need to re-install Python and check the box to add Python to your PATH or install pip on your command line.

Why pip install is not working?

One of the most common problems with running Python tools like pip is the “not on PATH” error. This means that Python cannot find the tool you're trying to run in your current directory. In most cases, you'll need to navigate to the directory in which the tool is installed before you can run the command to launch it.


2 Answers

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

like image 51
Eliah Kagan Avatar answered Oct 06 '22 01:10

Eliah Kagan


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
like image 41
flathead Avatar answered Oct 05 '22 23:10

flathead