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

Implicit dependency on NumPy headers not made explicit anywhere #814

Open
paulmelis opened this issue Sep 4, 2020 · 1 comment
Open

Comments

@paulmelis
Copy link

Hi, I've been on a quest the past two days to figure out why PyCall (through pyjulia) does not turn an Array on the Julia side into a NumPy array on the Python side (and produces a Python list instead). See paulmelis/blender-julia-test#2 for all the gory details in nailing it down, particularly paulmelis/blender-julia-test#2 (comment)

The problem turns out to be that the NumPy installation I was using (as part of Blender) did not contain any header files and so npyinitialize in numpy.jl fails. There is an error() raised at that point with message could not read __multiarray_api.h to parse PyArray_API but that apparently never surfaces to the user level. In this case it gets raised further on from NpyArray but gets hidden in the catch part of function PyObject(a::StridedArray{T}) where T<:PYARR_TYPES. The message certainly isn't printed. It's also not mentioned anywhere in the docs that NumPy headers are being parsed (I could only find a reference to this in #38 from 2013).

So please add a note somewhere in the readme that the headers are a requirement for the NumPy installation used and are being parsed (which is quite unexpected). And NumPy initialization silently failing is also pretty suboptimal.

@tkf
Copy link
Member

tkf commented Sep 6, 2020

Using Julia in Blender sounds like a very interesting project. It's unfortunate that PyCall does not work well ATM.

I agree that we need:

  1. Better error/warning message
  2. Better explanation on how numpy interop works
  3. A solution to use buffer interface instead of NumPy to export Julia arrays #38

I don't have the bandwidth to work on it right now so I'm just tagging it as "help wanted".

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

No branches or pull requests

2 participants