【问题标题】:Pip and pip3 not working after python3.7.10 installationpython3.7.10安装后pip和pip3不工作
【发布时间】: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

有什么建议吗?

【问题讨论】:

    标签: linux terminal pip


    【解决方案1】:

    尝试完全卸载python并重新安装它,甚至检查一次路径

    【讨论】:

    • 试过这样做..由于这个损坏的包而无法运行一些命令
    猜你喜欢
    • 1970-01-01
    • 2018-09-03
    • 2022-12-11
    • 2020-01-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多