【问题标题】:pip fails everytime I try to install any packages每次我尝试安装任何软件包时 pip 都会失败
【发布时间】:2018-10-18 13:08:03
【问题描述】:

我的 pip 不适用于任何包:

 regex_3/_regex.c:46:20: fatal error: Python.h: No such file or directory
     #include "Python.h"
                        ^
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

当我试图通过

解决这个问题时
sudo apt-get install python3-dev

我知道了:

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-dev : Depends: python3 (= 3.5.1-3) but 3.5.1-4 is to be installed
               Depends: libpython3-dev (= 3.5.1-3) but it is not going to be installed
               Depends: python3.5-dev (>= 3.5.1-2~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

我无法安装任何这些依赖项!谁能帮帮我。

【问题讨论】:

  • 尝试sudo apt-get update,然后再次尝试sudo apt-get install python3-dev。这有帮助吗?

标签: python linux pip


【解决方案1】:

您应该能够通过以下方式查看持有的包裹列表:

apt-mark showhold 

然后通过

取消持有它们
sudo apt-mark unhold <package name>

之后,您应该能够删除冲突的软件包,然后重新安装所有。

尝试删除所有未满足的依赖项,然后重新安装。

【讨论】:

  • 谢谢,但这似乎不起作用...apt-mark showhold 什么也没显示
猜你喜欢
  • 2021-11-25
  • 2021-04-26
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-08-02
相关资源
最近更新 更多