简体   繁体   中英

Missing Python.h and impossible to find

I know there are already similar questions about the missing Python.h but NO solution worked for me by now.

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

Python appears to be already installed on my Ubuntu 12.04 system. In fact whenever I run the command

$ python -V

I get the output 2.7.3

Anyway when I try to locate Python.h no file is found. Python libraries are located in usr/lib/ but no headers in the folder.

Mind that I already tried the most common solution for this problem, that is $ sudo apt-get install python-dev , and also $ sudo apt-get update . None of them worked for me.

What should I do now? I tried to remove and reinstall python-dev, with no success. I only think to manually download and place the header into the folder usr/lib/python2.7. But I doubt it is a good idea. Can somebody help me? Thank you in advance.`

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

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

You can locate what packages contain the file with the command:

dpkg -S Python.h

or list what files are installed with a package with:

dpkg -L python2.7-dev

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM