6

I have just installed Ubuntu 20.04 and I have come across an issue when trying to install pip. On my older machines running 18.04, the command ran fine and installed the package. However, when installing it on 20.04, I am getting this issue:

toffee@theia:~$ sudo apt-get install python-pip
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package python-pip

I have the universe repo added, I have done countless reboots, updates and upgrades. Is there any way I can fix this?

5

I don't believe python-pip exists anymore in 20.04, looks like it has been removed from the repositories and is removed during the upgrade from 18.04(in my case 19.10) to 20.04. Maybe the functionality of the package has been bundled with a different python package?

20.04 upgrade

1
  • 3
    Ubuntu 20.04 dropped support for Python 2.x which was defunct since beginning of the year anyway. It comes with Python 3 out of the box, or you can install it from your repos if that's not the case, but forget about Python 2 on the latest Ubuntu, it just won't install.
    – user1019780
    Apr 24 '20 at 19:16
5

Use pip3 instead of pip

I will assume you are using the Python3 version so you can install pip3 with

sudo apt-get install python3-pip

then you can install whatever you wanted starting with;

pip3 install

All the best :)

1
  • Thanks for this! The thing is the program I was trying to install required python 2 which I am just hoping gets updated to use python 3.
    – Toffee
    Jun 8 '20 at 19:56
1

First of all try to search package

apt-cache search pip | grep python

Then

dpkg -l | grep python

to see if python is installed Finally try

python3 -m pip 
2
  • 1
    Sorry for the confusion, I was referring to python 2 specifically. It has been removed from the repos apparently. Thank you for the help.
    – Toffee
    Apr 25 '20 at 14:29
  • You are welcome. Apr 25 '20 at 14:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.