0

In my CentOS 7.7, I installed python3 yum install python3 and I want to install the gevent by pip3, but get below error:

    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/

I found google, let me install the python-dev, but after I installed it, there still exist this error.


Update: My pip3 version is 9.0.3.

# pip3 --version
pip 9.0.3 from /usr/lib/python3.6/site-packages (python 3.6)
26334_zeal
  • 191
  • 11

1 Answers1

2

your pip version is low, you should update it.

by command:

sudo pip3 install pip --upgrade
aircraft
  • 25,146
  • 28
  • 91
  • 166
  • Updating pip and python dev package fixed my issue. sudo pip3 install pip --upgrade && sudo yum install python3.x-level – dnyanesh Oct 22 '21 at 09:28