Do you have package python-dev installed? That's where Python.h comes from.
These are the steps to find this information out for yourself:
Run apt-file search Python.h to find all packages that provide files that have Python.h in their name (You might have to install apt-file first). This lists a lot of packages, but most provide files like Symbol-Tables-In-Python.html. The only packages that provide a Python.h file are pythonX.X-dbg and pythonX.X-dev packages. Now, -dbg packages contain debug version of programs, while -dev contain development files such as C header files, and Python.h is such a file.
This narrows the list of packages down to python2.6-dev, python2.7-dev, and python3.2-dev. One way to check which of these version is the canonical one is to simple remove the version number from the package name, and check if this exists: apt-cache show python-dev:
Package: python-dev
Priority: optional
Section: python
Installed-Size: 32
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Matthias Klose <doko@debian.org>
Architecture: all
Source: python-defaults
Version: 2.7.2-7ubuntu2
Depends: python (= 2.7.2-7ubuntu2), python2.7-dev (>= 2.7.2-3~)
Filename: pool/main/p/python-defaults/python-dev_2.7.2-7ubuntu2_all.deb
Size: 1008
MD5sum: d8ef295ca23c3f46298daaa0ccb25403
SHA1: 057d3802fb2afb2a4f85906d65fcb2589568a377
SHA256: 1f5340056e70d6ff573e43f42365b1fd96cee7870ec6ed42c3be4eba6216a092
Description-en: header files and a static library for Python (default)
Header files, a static library and development tools for building
Python modules, extending the Python interpreter or embedding Python
in applications.
.
This package is a dependency package, which depends on Debian's default
Python version (currently v2.7).
Homepage: http://www.python.org/
Description-md5: 93a1917c3f17606b40377d0b737c6c92
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
Supported: 18m
The Depends: line shows that it will install python2.7-dev, so you can just install python-dev.
Since I already had the correct packages installed, I could use locate Python.h and then dpkg -S /usr/include/python2.7/Python.h to find the package that contains Python.h.
python-devinstalled? That's where Python.h comes from – daniel kullmann Apr 8 '12 at 6:59python.hexists inpython-devbecause you work on Python or is there a way to identify? – Nanda Apr 8 '12 at 7:06locate Python.hwhich told me that this file resides in/usr/include/python2.7/Python.h. Then, I diddpkg -S /usr/include/python2.7/Python.h, which told me the package is python2.7-dev. This package is version-specific though, so I checked package python-dev withapt-cache show python-devto see whether this will automatically install python2.7-dev. Which it does; it's in theDepends: ...line. – daniel kullmann Apr 8 '12 at 7:15python-devand I have been able to installblockdiagnow. Thank you for such a clear explanation. This has been very helpful to me. I am on a learning curve with a Debian based system called CrunchBang and little things like this mean a great deal to me. Please post your comments as an answer and I would be glad to accept it as the answer. – Nanda Apr 8 '12 at 7:18