A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2004-March/043502.html below:

[Python-Dev] embedding python with numarray

[Python-Dev] embedding python with numarrayMarc Schellens m_schellens at hotmail.com
Thu Mar 25 09:25:16 EST 2004
Using Python 2.3.3,
trying to embed python with numarray,
my C++ application crashes (segmentation fault) at "import_libnumarray()",
(I c&p the macro, its within the macro at:
PyObject *module =
PyImport_ImportModule("numarray.libnumarray");
)

when I:

    1.
       initalize python and numarray like:
    ...
       Py_Initialize();
       import_libnumarray();
    ...

    2 .
       load another module like:

         PyObject* pModule = PyImport_Import(pName);


    3.
    call Py_Finalize()
    and do 1. again.

The palce where it crashes is:
Objects/typeobject.c
line 3004:
if (basebase->tp_as_sequence == NULL)


If I call import_libnumarray() only once (ie calling Py_Initialize()
without import_libnumarray() 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 array_str(self)
TypeError: 'NoneType' object is not callable


Any suggestions?
How can numarray be restarted properly after a Py_Finalize() ?
Thanks,
marc


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4