[Pythonmac-SIG] NumPy extensions on the Mac

Jack Jansen jack@oratrix.nl
Sun, 31 Dec 2000 13:23:55 +0100


Recently, Chris Barker <cbarker@jps.net> said:
> I'm using MacPython 1.5.2c1, and CodeWarrior Pro 5.
> 
> At the moment my problem is that 
> 
> PyArray_Check()  doesn't seem to work, it return false whether I pass in
> a NumPy array or any other object.

This is usually a sign that you have two copies of the numpy code,
probably the one that is a Python extension and another one that is
linked to your extension. Type checking works by comparing the
addresses of the typeobject pointer in the PyObject struct, so this
hypothesis is easy to check with the codewarrior debugger.

I'm not sure about the details under 1.5.2 (it's been a long time) but 
you have to make sure that your extension is linked against the .slb
that contains the numeric module, and that the two are in the same
folder during runtime (there's a few other ways to make sure the right 
one is found, but this is the easiest).

--
Jack Jansen             | ++++ stop the execution of Mumia Abu-Jamal ++++
Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++
www.oratrix.nl/~jack    | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm