I am trying to build a shared library using a C extension file but first I have to generate the output file using the command below:
gcc -Wall utilsmodule.c -o Utilc
After executing the command, I get this error message:
utilsmodule.c:1:20: fatal error: Python.h: No such file or directory compilation terminated.
in fact I have tried all the suggested solutions over the internet but the problem still exists ... also I have no problem with Python.h
. I managed to locate the file on my machine ... anybody has faced the same problem before??
In AWS API (centOS) its
On Ubuntu, I was running Python 3 and I had to install
If you want to use a version of Python that is not linked to python3, install the associated python3.x-dev package. For example:
on Fedora run this for Python 2:
and for Python 3:
It often appear when you trying to remove
python3.5
and installpython3.6
.So when using
python3
(whichpython3 -V
=>python3.6
) to install some packages requiredpython3.5
header will appear this error.Resolve by install
python3.6-dev
module.If you're using Python 3.6 on Amazon Linux (based on RHEL, but the RHEL answers given here didn't work):
For CentOS 7:
I followed the instructions here for installing python3.6 on several VMs: https://www.digitalocean.com/community/tutorials/how-to-install-python-3-and-set-up-a-local-programming-environment-on-centos-7 and was then able to build mod_wsgi and get it working with a python3.6 virtualenv