Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python.h missing on Ubuntu 18 with python-dev installed

Trying to get fHDHR working Ubuntu 18. During the install I get this error:

include/python3.8 -c src/gevent/libev/corecext.c -o build/temp.linux-x86_64-3.8/src/gevent/libev/corecext.o
  src/gevent/libev/corecext.c:95:10: 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

  ----------------------------------------
  Failed building wheel for gevent

Most answers I find tell me I need python-dev installed but it already is (and updated). In this post it was recommended to sudo pip install mmh3 which I tried but it also failed as unable to find python.h

Any idea what I am missing on my system?

like image 437
user2785588 Avatar asked Aug 07 '26 12:08

user2785588


1 Answers

You need to install python3.x-dev as explained here. For me this resolved the issue.

Since from the error line we can see that you are running python3.8, so for your case you would need to do:

sudo apt-get install python3.8-dev
like image 140
Saad_Khan Avatar answered Aug 10 '26 01:08

Saad_Khan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!