14

I installed Ubuntu 20.04 on a PC. I then tried to get started and install pip for python3. However nothing seemed to work. This is what I have tried so far:

sudo apt install python3-pip

This is the error I get:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package python3-pip is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'python3-pip' has no installation candidate

I have tried the solution proposed by Carlos Sanchez JR.: How to install Python package installer PIP on Ubuntu 20.04 Linux

After following the advice given in the link above I got this error when doing sudo apt update :

Ign:1 cdrom://Ubuntu 20.04 LTS _Focal Fossa_ - Release amd64 (20200423) focal InRelease
Hit:2 cdrom://Ubuntu 20.04 LTS _Focal Fossa_ - Release amd64 (20200423) focal Release
Hit:4 http://security.ubuntu.com/ubuntu focal-security InRelease              
Hit:6 http://archive.ubuntu.com/ubuntu focal InRelease                        
Get:5 http://kali.download/kali kali-rolling InRelease [30.5 kB]
Hit:7 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Err:5 http://kali.download/kali kali-rolling InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY ED444FF07D8D0BF6
Get:8 http://kali.cs.nctu.edu.tw/kali kali-rolling InRelease [30.5 kB]
Err:8 http://kali.cs.nctu.edu.tw/kali kali-rolling InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY ED444FF07D8D0BF6
Reading package lists... Done
W: GPG error: http://kali.download/kali kali-rolling InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY ED444FF07D8D0BF6
E: The repository 'http://http.kali.org/kali kali-rolling InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://kali.cs.nctu.edu.tw/kali kali-rolling InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY ED444FF07D8D0BF6
E: The repository 'http://kali.cs.nctu.edu.tw/kali kali-rolling InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

Trying sudo apt install python3-pip at this point just gives me the same E: Package 'python3-pip' has no installation candidate error as before. This is equally true when trying sudo apt-get install python3-pip.

I have found no other solutions to this problem.

3

10 Answers 10

39

Try this command

sudo apt-get install python3-pip

Note: If you have a fresh install, you need to do this first before trying the above command.

sudo apt-get update

3
  • 2
    I tried this. It gave me an error. I ended up just installing another version of Ubuntu instead. Now it works just fine.
    – Biochem
    Jun 11, 2020 at 16:24
  • 1
    That fixed it for me. I had already run update, but I guess I needed to run it again.
    – Stonecraft
    Oct 18, 2020 at 13:40
  • Boom! It was the sudo apt-get update that I was missing! Thank you bro! Aug 3 at 3:50
23

Try the following commands:

sudo apt-get install python3-setuptools
sudo python3 -m easy_install install pip
python3 -m pip --version
2
  • this is the only way on a live cd. apt update has nothing at cdrom://... and python3-pip is not ready yet. But setuptools and easy_install can bring pip3 to work
    – Sam
    Mar 30, 2021 at 12:08
  • This worked for me.
    – Daniel
    Dec 7, 2021 at 15:50
12

It means you have a fresh install.

try this:

sudo apt-get update 

Then just use the below commands, it works fine.

sudo apt-get install python3-setuptools
sudo python3 -m easy_install install pip
python3 -m pip --version
7

You need to enable the universe repository to install the official package for this.

$ sudo add-apt-repository universe
$ sudo apt-get install python3-pip
1
  • 2
    this is the only one that worked for me
    – ninhenzo64
    Oct 28, 2022 at 16:42
2

I faced the same problem on the AWS EC2. A simple sudo apt update solved the problem.

2
  • 1
    If you read the full question (and links provided) you will see it is one of the things I tried. Looking back I think it was probably some sort of hardware problem.
    – Biochem
    Jul 17, 2020 at 18:01
  • sudo apt update fixed it for me on a new Ubuntu Server 20.04 instance on AWS. Mar 11, 2021 at 19:22
1

From the error info of the apt-get update. That is caused by the kali apt source. The following signatures couldn't be verified because the public key is not available: NO_PUBKEY ED444FF07D8D0BF6

You can run following command at first

wget -q -O - https://archive.kali.org/archive-key.asc | apt-key add

or

apt-key adv --keyserver hkp://keys.gnupg.net --recv-keys ED444FF07D8D0BF6
dpkg --configure -a

Then you can run following commands to install pip.

sudo apt-get update
sudo apt install python3-pip
0

This might work:

python3 -m pip3 install -U pip3

or:

python3 -m pip install -U pip
1
  • I tried this. It gave me an error. I ended up just installing another version of Ubuntu instead. Now it works just fine.
    – Biochem
    Jun 11, 2020 at 16:24
0

I had pretty much the same issue on Ubuntu 19.04. Seems the repositories for this version had issues with sudo apt update ... ip addresses and repositories where not resolvingl

As I was doing this in a vm, I installed Ubuntu 16.04 and everything worked as it should without issues.

Follow these steps https://docs.python-guide.org/starting/install3/linux/

And then this works.

sudo apt install python3-pip

0

Method 1:

To install pip, securely download get-pip.py using curl:

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py

Then run the following command in the folder where you have downloaded get-pip.py:

python get-pip.py

Warning Be cautious if you are using a Python install that is managed by your operating system or another package manager. get-pip.py does not coordinate with those tools, and may leave your system in an inconsistent state.


Method 2:

Be cautious using this method, but it worked for me:

cd ~
rm -rf .local
rm -rf .cache
sudo apt get python3-pip
0

It worked for me(with @G.Pavan Kumar help):

Step1: sudo apt-get update

Step2: sudo apt-get install python3-pip

Step3: sudo apt-get update (tried to update but i guess didn't go well so i tried to fix the missing updates in the following step)

Step4: sudo apt-get update --fix-missing

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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