Skip to content

Install pip#

Pip (Package Installer for Python) is the PyPA recommended tool for installing Python packages.

Official page: https://pypi.python.org/pypi/pip

Install pip3 for python3 (Ubuntu 20.04)#

First, install Python.

Then:

sudo apt install python3-pip

Install latest pip on GNU/Linux#

wget https://bootstrap.pypa.io/get-pip.py | sudo python

Install latest pip3 on GNU/Linux#

wget https://bootstrap.pypa.io/get-pip.py | sudo python3

Troubleshooting#

There is a bug in some versions of pip that disables pip after an upgrade (pip install --upgrade pip) with the following error:

Traceback (most recent call last):
  File "/usr/bin/pip3", line 9, in <module>
    from pip import main
ImportError: cannot import name 'main'

The simplest fix found here is to run the following command to upgrade pip by installing again the latest version (use python instead for python2):

wget https://bootstrap.pypa.io/get-pip.py | sudo python3