E:软件包“ python-pip”没有候选安装

时间:2020-10-03 18:25:49

标签: python python-3.x linux pip

$ sudo apt-get install python-pip
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package python-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
However the following packages replace it:
  python3-pip

我的pip和pip3都安装在python 3中

pip -V
pip 20.1.1 from /usr/lib/python3/dist-packages/pip (python 3.8)


pip3 -V
pip 20.1.1 from /usr/lib/python3/dist-packages/pip (python 3.8)

现在 不能 安装 点子 ... 显示 上方 错误

3 个答案:

答案 0 :(得分:4)

如果已安装python(python2),则可以使用以下命令安装pip(用于python2)。

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

现在您可以检查pip2

pip2 --version

希望这些对您有帮助

答案 1 :(得分:0)

就像错误消息告诉您的一样,该软件包曾经用于Python 2,但是您拥有Python 3,并且您已经安装了pip

答案 2 :(得分:-1)

首先使用这些命令,然后重试并通过sudo apt reinstall python3-pip

重新安装
  1. sudo add-apt-repository universe
  2. sudo add-apt-repository multiverse
  3. sudo apt-get update