[BangPypers] import error undefined symbol: Py_InitModule4
kracekumar at hasgeek.com
Fri Jan 11 10:49:55 CET 2013
On Fri, Jan 11, 2013 at 3:12 PM, Kracekumar Ramaraju <kracekumar at hasgeek.com
> AFAIK, Anything with python2.4 or python2.5 compilation or any third party
> installation will not work since all dependencies changed.
> What I mean is make file, python-dev etc are changed.
> On Fri, Jan 11, 2013 at 2:54 PM, Dileep <dileep.ds at gmail.com> wrote:
>> I am working on cython code and after compilation I am getting the above
>> import error with compiled .so file. I am using python 2.4 and testing on
>> 64 bit machine. I think
>> the issue happened because calling python interpreter and the extension do
>> not use the same version.(one is Python 2.4, the other 2.5).
>> As per PEP0353 (http://www.python.org/dev/peps/pep-0353/ ) there is a
>> change for 64 bit machines.To prevent loading extension modules that
>> a 32-bit size type into an interpreter that has a 64 bit size type,
>> Py_InitModule4 is renamed to Py_InitModule4_64.
>> By adding the below lines of code to my extension .c file will fix that
>> issue ? any one faced similar issue ?
>> #if SIZEOF_SIZE_T != SIZEOF_INT
>> /* On a 64-bit system, rename the Py_InitModule4 so that 2.4
>> modules cannot get loaded into a 2.5 interpreter */
>> #define Py_InitModule4 Py_InitModule4_64
>> BangPypers mailing list
>> BangPypers at python.org
> "Talk is cheap, show me the code" -- Linus Torvalds
"Talk is cheap, show me the code" -- Linus Torvalds
More information about the BangPypers