【发布时间】:2021-07-18 00:24:30
【问题描述】:
我在安装 pip 时遇到此错误。以前,我有 python 3.5.2,我升级到 python 3.7.10。然后我使用以下命令更改了默认的 python3 版本:
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 2
之后,每当我使用 pip 或 pip3 时,它都会显示此错误:
Traceback (most recent call last):
File "/usr/local/bin/pip", line 5, in <module>
from pip._internal.cli.main import main
ModuleNotFoundError: No module named 'pip'
现在在尝试安装 pip 时,出现此错误..
:~$ sudo apt-get 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.
installed
有什么建议吗?
【问题讨论】: