Python.h: No such file or directory

From Helpful
Jump to navigation Jump to search

...and a waterfall of errors below it, caused by things not being defined (such as PyObject undeclared and PyExc_ImportError undeclared).


This usually means you don't have the headers for libpython installed.

You'll have to install some python source/development package, probably a package mentioning 'python' and 'dev' in its name - the debian/ubuntu the package is called "python2.6-dev", or similar for your python version.


If you do have these development files installed, they're probably not in a place gcc is looking, and you may need to point it to additional paths to include (at least -I for header files; see also e.g. [1]).