ubuntu – How to install pip for Python 2

ubuntu – How to install pip for Python 2

To install pip for Python2 on Ubuntu, this worked for me

sudo apt update
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
sudo python2 get-pip.py

Its based on DareDevil7s answer but notice the url is different.

I would suggest that you use pyenv to manage multiple versions of Python, because it can often get problematic. Right now the solution to the problem would depend on the configuration you have for pip and python in your bash.

One thing you can do is download the easy_install script, and use python 3 to run it and install pip for python 3 alone.

ubuntu – How to install pip for Python 2

If you really want to install pip globally for your system use the get-pip.py script with the wanted python binary http://www.pip-installer.org/en/latest/installing.html#install-or-upgrade-pip

python2.7 get-pip.py

But you should consider using virtualenv / buildout to get an isolated environment

Leave a Reply

Your email address will not be published. Required fields are marked *