How to install pip for Python 2

Paul Draper picture Paul Draper · Jan 23, 2014 · Viewed 31.9k times · Source

I run

python --version

and get

Python 2.7.3

I run

pip --version

and get

pip 1.5 from /usr/local/lib/python3.2/dist-packages/pip-1.5-py3.2.egg (python 3.2)

I installed pip using apt-get. How to I get the Python 2 version of pip?

I've reinstalled python and python-pip several times with apt-get. I'm also curious why these would install different Python versions.

Answer

Swish Tom picture Swish Tom · May 26, 2018

If there are both python2.7 and python3 in you ubuntu system,run this

sudo apt install python-pip

There will be pip for python3 ,pip2 for python2