[Numpy-discussion] embeddedPyArray_FromDimsAndDataSegmentationFault

Thomas Hrabe thrabe@burnham....
Tue May 20 15:36:25 CDT 2008


Thats what PyErr_Print() prints.
Python is initialised, for sure

Traceback (most recent call last):
  File "/usr/global/python32/lib/python2.4/site-packages/numpy/__init__.py", lin
e 34, in ?
    import testing
  File "/usr/global/python32/lib/python2.4/site-packages/numpy/testing/__init__.
py", line 3, in ?
    from numpytest import *
  File "/usr/global/python32/lib/python2.4/site-packages/numpy/testing/numpytest
.py", line 8, in ?
    import unittest
  File "/usr/global/python32/lib/python2.4/unittest.py", line 51, in ?
    import time
ImportError: /usr/global/python32/lib/python2.4/lib-dynload/time.so: undefined s
ymbol: PyExc_IOErro

why does it work in C and not in C started within Matlab?

-----Original Message-----
From: numpy-discussion-bounces@scipy.org on behalf of Robert Kern
Sent: Tue 5/20/2008 12:23 PM
To: Discussion of Numerical Python
Subject: Re: [Numpy-discussion] embeddedPyArray_FromDimsAndDataSegmentationFault
 
On Tue, May 20, 2008 at 2:01 PM, Thomas Hrabe <thrabe@burnham.org> wrote:
> After all, I figured how to create an numpy in C with the help below.
>
> If called in C, import_array() but actually _import_array() successfully
> creates all the instances needed for the array.
> However, once I call this function from another environment such as Matlab,
>   PyObject *numpy = PyImport_ImportModule("numpy.core.multiarray");
> in __import_array() returns NULL, because numpy.core.multiarray is not
> found?

Something like that. Call PyErr_Print() do display the full traceback
so you can find out what the actual problem is.

> Do you think it might depend on the path settings?

You've called Py_Initialize() before you do anything else with Py*
functions, right?

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
 -- Umberto Eco
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 4176 bytes
Desc: not available
Url : http://projects.scipy.org/pipermail/numpy-discussion/attachments/20080520/c10b8334/attachment.bin 


More information about the Numpy-discussion mailing list