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
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.
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.
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.
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).
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With