[Python-Dev] embedding python with numarray (original) (raw)

Guido van Rossum guido at python.org
Thu Mar 25 10:41:26 EST 2004


Using Python 2.3.3, trying to embed python with numarray, my C++ application crashes (segmentation fault) at "importlibnumarray()", (I c&p the macro, its within the macro at: PyObject *module = PyImportImportModule("numarray.libnumarray"); )

when I: 1. initalize python and numarray like: ... PyInitialize(); importlibnumarray(); ... 2 . load another module like: PyObject* pModule = PyImportImport(pName);

3. call PyFinalize() and do 1. again. The palce where it crashes is: Objects/typeobject.c line 3004: if (basebase->tpassequence == NULL) If I call importlibnumarray() only once (ie calling PyInitialize() without importlibnumarray() the second time, I cannot use numarray: Traceback (most recent call last): File "/usr/local/gdl/gdl/test.py", line 5, in testfun print a File "/usr/local/lib/python2.3/site-packages/numarray/numarraycore.py", line 660, in str return arraystr(self) TypeError: 'NoneType' object is not callable Any suggestions? How can numarray be restarted properly after a PyFinalize() ?

This seems to be a numarray problem. I don't have the numarray source handy; I suggest that you bring this under the attention of the numarray developers. If they can't figure out what they need to fix we're here to help.

--Guido van Rossum (home page: http://www.python.org/~guido/)



More information about the Python-Dev mailing list