[Numpy-discussion] Pyrex and numpy

Francesc Altet faltet at carabos.com
Thu Dec 14 13:30:47 CST 2006

El dj 14 de 12 del 2006 a les 11:21 -0700, en/na Tim Hochberg va
> I was just going to try pyrex out with numpy to see how it compares with 
> weave (which is cool but quirky). My first attempt ended in failure: I 
> tried to compile the demo in in numpy/doc/pyrex and got this error:
>    c_numpy.pxd:99:22: Array element cannot be a Python object
> Does anyone who uses pyrex see this? Does anyone know what it's from? 
> Not that I deleted numpyx.c, since otherwise pyrex isn't invoked at all?

Mmm, I can compile and run the example just fine. That's strange because
your Pyrex error seems to tell that NPY_MAXDIMS is a Python object
instead of an integer. But in my numpy installation, NPY_MAXDIMS is
defined in ndarrayobject.h, which should be imported automatically by
Pyrex in:

cdef extern from "numpy/arrayobject.h":

block (which should include ndarrayobject.h).

Sorry for not being able to help more,

Francesc Altet    |  Be careful about using the following code --
Carabos Coop. V.  |  I've only proven that it works, 
www.carabos.com   |  I haven't tested it. -- Donald Knuth

More information about the Numpy-discussion mailing list