Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Proper way to install pip on Ubuntu

Tags:

python

pip

I'm trying to install the latest version of pip (currently 8.1.2) on the official ubuntu/trusty64 Vagrant box. The box comes with Python 2.7.6 and 3.4.3 pre-installed with apt-get.

I read the pip installation doc and it contains the following warning:

Be cautious if you're using a Python install that's managed by your operating system or another package manager. get-pip.py does not coordinate with those tools, and may leave your system in an inconsistent state.

Does that mean I cannot install pip using get-pip.py and I am limited to install an older version of it from apt-get?

If there is a better way of installing it, what would it be?

Thanks

like image 585
peflorencio Avatar asked Jun 21 '16 20:06

peflorencio


People also ask

What is the best way to install pip?

Step 1: Download the get-pip.py (https://bootstrap.pypa.io/get-pip.py) file and store it in the same directory as python is installed. Step 2: Change the current path of the directory in the command line to the path of the directory where the above file exists. Step 4: Now wait through the installation process.

Where is pip installed Ubuntu?

By default, on Linux, Pip installs packages to /usr/local/lib/python2. 7/dist-packages. Using virtualenv or --user during install will change this default location. If you use pip show make sure you are using the right user or else pip may not see the packages you are referencing.

Do I need to install pip in Ubuntu?

Pip is a package management system that simplifies installation and management of software packages written in Python such as those found in the Python Package Index (PyPI). Pip is not installed by default on Ubuntu 18.04, but the installation is pretty straightforward.


1 Answers

I believe that you can install it on Ubuntu with

sudo apt-get install python-pip 

or

sudo apt-get install python3-pip 

for Python 3. Sure, it's an older version but its functionality is there.

like image 199
Michael Zhang Avatar answered Sep 27 '22 23:09

Michael Zhang