当我在 Ubuntu 16.04 上运行命令时sudo apt install python3-pip
出现这些错误
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
python3-pip : Depends: python-pip-whl (= 8.1.1-2) but 8.1.1-2ubuntu0.4 is to be installed
Recommends: python3-dev (>= 3.2) but it is not going to be installed
Recommends: python3-wheel but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
答案1
只需删除python-pip-whl
包并重试:
sudo apt-get remove python-pip-whl
答案2
经过大量搜索后,我终于能够通过运行以下命令在我的 Ubuntu 16.04 机器上安装 pip3
sudo apt-get install python3-setuptools
sudo easy_install3 pip
答案3
您的包裹已损坏,因此请使用以下步骤:
修复损坏的软件包:
sudo apt -f install
更新:
sudo apt update && sudo apt dist-upgrade
现在正常安装:
sudo apt install python3-pip
检查是否安装:
pip3 --version
这应该可以解决这个问题。
答案4
经过大量搜索后,这终于对我有用
sudo apt-get install aptitude
然后使用以下命令安装 pip3:
sudo aptitude install python3-pip