Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (47.6k points)

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??

1 Answer

0 votes
by (106k points)

On Ubuntu, you can resolve your issue by installing Python using the following ways because the error that you are getting is an installation error:-

sudo apt-get install python3-dev

A version of Python that is not linked to python3, in that case, install the associated python3.x-dev package.

 For example:

sudo apt-get install python3.5-dev

Related questions

Browse Categories

...