【问题标题】:Why does it gives error while installing pip? [duplicate]为什么安装pip时会出错? [复制]
【发布时间】:2021-06-12 07:50:26
【问题描述】:

安装pip 时出现错误。我安装了python 3.9.2

root@kali:~# 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: python3-distutils but it is not going to be installed
               Depends: python3-setuptools but it is not going to be installed
               Recommends: python3-dev (>= 3.2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
root@kali:~# ^C

enter image description here

【问题讨论】:

标签: python pip kali-linux


【解决方案1】:

Pip 随 Python 2 >=2.7.9 或 Python 3 >=3.4 一起安装。

首先检查它使用:

python -m pip --version

手动安装: 首先,运行此代码以使用 curl 下载 get-pip.py。

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

然后,在你安装 get-pip.py 的文件夹中运行这个命令

python get-pip.py

【讨论】:

    【解决方案2】:

    这很奇怪,但我认为 apt-get 应该检索任何依赖项。然而它会告诉你它缺少什么并拒绝安装它们。有没有试过安装依赖,然后pip?

    我对@9​​87654322@ 不太熟悉,但我建议检查错误消息以了解它拒绝安装依赖项的原因。您的屏幕截图没有完整的信息。

    最后的手段是强制安装选项。看看它是否将--force 理解为参数。请注意,这可能会使您的包管理系统处于一种奇怪的状态,如果它还没有的话。

    我不确定“ig”是什么,但我不打算将其他社交网络应用程序链接到这个。

    【讨论】:

    • 我无法阅读更多您的错误记录(图片),但对于 Linux 系统,强制安装 pip 往往会在以后弄乱依赖关系。
    • 我该怎么做
    • 你能给我你的ig吗
    猜你喜欢
    • 2021-02-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-10-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多