如何在 ubuntu 20.04 上安装 python3-pip

Bio*_*hem 4 python linux ubuntu pip ubuntu-20.04

我在 PC 上安装了 Ubuntu 20.04。然后我尝试开始并为python3安装pip。然而,似乎没有任何效果。这是我迄今为止尝试过的:

sudo apt install python3-pip
Run Code Online (Sandbox Code Playgroud)

这是我得到的错误:

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
Run Code Online (Sandbox Code Playgroud)

我已经尝试了 Carlos Sanchez JR 提出的解决方案: How to install Python package installer PIP on Ubuntu 20.04 Linux

按照上面链接中给出的建议后,我在执行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.
Run Code Online (Sandbox Code Playgroud)

sudo apt install python3-pip在这一点上尝试只会给我E: Package 'python3-pip' has no installation candidate和以前一样的错误。

我没有找到解决这个问题的其他方法。

小智 12

试试这个命令

sudo apt-get install python3-pip

注意:如果您是全新安装,则需要在尝试上述命令之前先执行此操作。

sudo apt-get update

  • 我试过这个。它给了我一个错误。我最终只是安装了另一个版本的 Ubuntu。现在效果很好。 (2认同)

小智 12

这意味着您进行了全新安装。

尝试这个:

sudo apt-get update 
Run Code Online (Sandbox Code Playgroud)

然后只需使用下面的命令,就可以正常工作了。

sudo apt-get install python3-setuptools
sudo python3 -m easy_install install pip
python3 -m pip --version
Run Code Online (Sandbox Code Playgroud)


ken*_*orb 11

尝试以下命令:

sudo apt-get install python3-setuptools
sudo python3 -m easy_install install pip
python3 -m pip --version
Run Code Online (Sandbox Code Playgroud)


fuz*_*Tew 7

您需要启用 Universe 存储库才能安装官方包。

$ sudo add-apt-repository universe
$ sudo apt-get install python3-pip
Run Code Online (Sandbox Code Playgroud)

  • 这是唯一对我有用的 (2认同)