簡體   English   中英

E: 包 'python-pip' 沒有安裝候選

[英]E: Package 'python-pip' has no installation candidate

$ 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)

現在無法安裝pip ...顯示上述錯誤

如果你安裝了 python(python2),那么你可以使用以下命令來安裝 pip(for python2)。

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

現在您可以檢查 pip2

pip2 --version

我希望這些會幫助你

僅供參考,如果您使用的是 Windows Ubuntu Shell 並且您的防火牆阻止了 Ubuntu 沙箱的流量,則可能會出現此問題。 在這種情況下,無法找到安裝資源,簡單apt-update將不起作用。

為了測試防火牆是否導致您的問題,您可以簡單地嘗試 ping 一個 網站 此外,如果apt-updateconnection refused而失敗,則防火牆可能是您的問題。 查看這篇文章,了解如何將沙箱添加到防火牆白名單(端點保護)。

$ 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)

現在無法安裝點子...顯示上面的錯誤

首先使用這些命令然后再試一次並通過sudo apt reinstall python3-pip執行重新sudo apt reinstall python3-pip

  1. sudo add-apt-repository universe
  2. sudo add-apt-repository multiverse
  3. sudo apt-get update

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM