[Numpy-discussion] Changing Fatal error into ImportError?

Fernando Perez fperez.net at gmail.com
Wed Aug 30 17:36:19 CDT 2006


On 8/30/06, Robert Kern <robert.kern at gmail.com> wrote:

> I don't see where we're calling Py_FatalError. The problem might be in Python or
> mwadap. Indeed, import_array() raises a PyExc_ImportError.

Sorry for the noise: it looks like this was already fixed:

http://projects.scipy.org/scipy/numpy/changeset/3044

since the code causing problems had been built /before/ 3044, we got
the FatalError.

But with modules built post-3044, it's all good (I artificially hacked
the number to force the error):

In [1]: import mwadap
Overwriting info=<function info at 0x4158402c> from scipy.misc (was
<function info at 0x4067410c> from numpy.lib.utils)
---------------------------------------------------------------------------
exceptions.RuntimeError                              Traceback (most
recent call last)


RuntimeError: module compiled against version 1000001 of C-API but
this version of numpy is 1000002
---------------------------------------------------------------------------
exceptions.ImportError                               Traceback (most
recent call last)

/home/fperez/research/code/mwadap-merge/mwadap/test/<ipython console>

/home/fperez/usr/lib/python2.3/site-packages/mwadap/__init__.py
      9 glob,loc = globals(),locals()
     10 for name in __all__:
---> 11     __import__(name,glob,loc,[])
     12
     13 # Namespace cleanup

/home/fperez/usr/lib/python2.3/site-packages/mwadap/Operator.py
     18
     19 # Our own packages
---> 20 import mwrep
     21 from mwadap import mwqmfl, utils, Function, flinalg
     22

ImportError: numpy.core.multiarray failed to import

In [2]:


Cheers,

f




More information about the Numpy-discussion mailing list