给出错误 python3-pip

给出错误 python3-pip

我正在使用 Ubuntu 21.10。当我在命令行中输入以下内容时:

sudo apt-get install python3-pip

它给出了这个:

Reading package lists... Done
Building dependency tree... Done
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-distutils : Depends: python3-lib2to3 (= 3.9.5-0ubuntu3) but 3.9.7-1 is to be installed
 python3-setuptools : Depends: python3-pkg-resources (= 52.0.0-3) but 52.0.0-4 is to be installed
E: Unable to correct problems, you have held broken packages.

我该如何解决这个问题?

答案1

当我遇到这个问题时我这样做是为了解决它

sudo apt update --fix-missing
sudo apt install -f python3-pip 

对我来说效果很好,如果这个方法不管用,我朋友就用了这个方法

python get-pip.py

并安装好了

如果这些都不起作用,我知道最后要尝试的是

sudo python -m pip install pip

答案2

我刚刚遇到了和你同样的问题。首先运行以下命令即可解决:

sudo apt update --fix-missing

然后:

sudo apt-get install python3-pip

相关内容