pip fails everytime I try to install any packages

2019-08-02 18:42发布

My pip didn't work for any package:

 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

when I tried to fix this by

sudo apt-get install python3-dev

I got this:

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.

and i can't install any of these dependencies!Could someone help me out.

标签: python linux pip
1条回答
闹够了就滚
2楼-- · 2019-08-02 19:25

You should be able to see the list of held packages by:

apt-mark showhold 

and then un-hold them by

sudo apt-mark unhold <package name>

After that, you should be able to remove the conflicting packages and then reinstall all.

Try removing all the unmet dependencies and then reinstalling.

查看更多
登录 后发表回答