当前位置: 首页 > 知识库问答 >
问题:

src/gevent/libev/corecext.c:95:20:致命错误:python.h错误:命令“gcc”失败,退出状态为1[重复]

狄元魁
2023-03-14

在CentOS 7.7中,我安装了python3yum install python3,我想通过pip3安装Gevent,但得到以下错误:

    src/gevent/libev/corecext.c:95:20: Fatal error:Python.h:there is no that directory or file
     #include "Python.h"
                        ^
    Compilation interrupt
    error: command 'gcc' failed with exit status 1
    
    ----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-9sbqi31b/gevent/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-zgsgc2dj-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-9sbqi31b/gevent/
# pip3 --version
pip 9.0.3 from /usr/lib/python3.6/site-packages (python 3.6)

共有1个答案

喻高寒
2023-03-14

您的pip版本低,您应该更新它。

通过命令:

sudo pip3 install pip --upgrade
 类似资料: