Launching some small VMs in GCP and thought I would give Ubuntu 20.04 LTS minimal a try. After doing an "apt update; apt upgrade" I'm able to install packages like Apache, but having zero luck with PIP:
root@ubuntu-rr58:/home/me# apt install python-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python-pip
I have verified the Universe, Multiverse and Restricted repositories are available:
root@ubuntu-rr58:~# grep ^deb /etc/apt/sources.list
deb http://us-central1.gce.archive.ubuntu.com/ubuntu/ focal main restricted
deb http://us-central1.gce.archive.ubuntu.com/ubuntu/ focal-updates main restricted
deb http://us-central1.gce.archive.ubuntu.com/ubuntu/ focal universe
deb http://us-central1.gce.archive.ubuntu.com/ubuntu/ focal-updates universe
deb http://us-central1.gce.archive.ubuntu.com/ubuntu/ focal multiverse
deb http://us-central1.gce.archive.ubuntu.com/ubuntu/ focal-updates multiverse
deb http://us-central1.gce.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse deb http://security.ubuntu.com/ubuntu focal-security main restricted
deb http://security.ubuntu.com/ubuntu focal-security universe
deb http://security.ubuntu.com/ubuntu focal-security multiverse
The package is called
python3-pip
. Python 2.7 is not shipped anymore with Ubuntu 20.04, nearly all python related packages are now calledpython3-*
.To get the Python 2 version of pip back, you can use get-pip, which is a single script that downloads and installs the latest version of pip (for Python 2 or 3, whichever version you run the script with):
Then add
~/.local/bin/
to your PATH (e.g. in your~/.bashrc
):After that you should have a working
pip
command for Python 2. Or usepip2
/pip2.7
if you want to make sure you're not targeting Python 3.