gcc - Distutils can't find Python.h -
i have distutils setup script extension section, looks this:
from distutils.core import setup, extension my_module = extension('my_module', sources = ['my_file.c', 'my_other_file.c']) setup (name = 'my_module', version = '1.0', description = 'my module', ext_modules = [my_module])
running setup.py build
works fine on mac. when move debian machine, fails:
error: python/python.h: no such file or directory
i have python2.6
, python2.6-dev
installed, , file present @ /usr/include/python2.6
.
the command executes problem file:
gcc -pthread -fno-strict-aliasing -dndebug -g -fwrapv -o2 -wall -wstrict-prototypes -fpic -i/usr/include/python2.6 -c my_module.c -o -build/xyz/my_module.o
so passing in location of header file.
the obvious difference between mac vs linux environment gcc-4.2 vs gcc-4.4 , python 2.7 vs python 2.6
ideas?
edit:
in c file in question:
#include <python/python.h> #include <python/structmember.h>
may in module, need include "python.h"
instead of "python/python.h"
?
or may try exporting include path, , try compiling again gcc or g++?
export c_include_path=/usr/include/python2.6:$c_include_path export cplus_include_path=/usr/include/python2.6:$cplus_include_path
Comments
Post a Comment