Python.h is missing and impossible to find

I know that there are already similar questions about the missing Python.h, but the NO solution didn't work for me anymore.

I need Python libraries to use Tossim, which is a tinyOS simulator ( http://tinyos.net ).

Python seems to be already installed on my Ubuntu 12.04 system. In fact, whenever I run a command

$ python -V 

I get output 2.7.3

Anyway, when I try to find Python.h, the file was not found. Python libraries are located in usr / lib /, but there are no headers in the folder.

Remember that I have already tried the most common solution to this problem, i.e. $ sudo apt-get install python-dev , as well as $ sudo apt-get update . None of them worked for me.

What should I do now? I tried uninstalling and reinstalling python-dev without any success. I only think to manually download and put the header in the usr / lib / python2.7 folder. But I doubt this is a good idea. Can someone help me? Thank you in advance.

0
source share
1 answer

Ubuntu (and Debian) saves Python files in /usr/include/python2.7 . If the python2.7-dev package is installed (dependency on python-dev ), then Python.h will be located at:

 /usr/include/python2.7/Python.h 

You can find which packages contain the file with the command:

 dpkg -S Python.h 

or specify which files are installed with the package using:

 dpkg -L python2.7-dev 
+1
source

Source: https://habr.com/ru/post/975389/


All Articles