Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiarray API returns NULL pointer #4

Closed
nfoti opened this issue Feb 24, 2013 · 1 comment
Closed

Multiarray API returns NULL pointer #4

nfoti opened this issue Feb 24, 2013 · 1 comment

Comments

@nfoti
Copy link

nfoti commented Feb 24, 2013

I think that PyCall is great and was really excited to see I could use pyplot from it. However, I've hit a small problem.

I am using Python 2.7.2 and numpy 1.8_dev_3abd869 installed with the ScipySuperpack on OSX 10.8. In the npyinitialize function on line 55 of numpy.jl the attempt to find the function pointer to the numpy multiarray _ARRAY_API as a PyCapsule returns a NULL pointer and thus anything that used numpy arrays failed, for example the pyplot example. I found that on my system numpy.core.multiarray._ARRAY_API is a PyCObject so I tried the code on line 51 of numpy.jl and a non-zero function pointer was returned. I hacked the Python 2.7.2 case to try the PyCapsule version and if a NULL pointer is returned then to try the PyCObject version. Now the pyplot example works as do numpy functions that use arrays.

I'm not sure what the right way is to handle this, but I just wanted to bring it to your attention.

Thanks.

@stevengj
Copy link
Member

You're quite right. I just checked the Numpy source, and they only use the PyCapsule version for Python 3+ (even though PyCObject was deprecated in Python 2.7). I will post an updated version of PyCall soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants