Stewori / JyNI

Enables Jython to load native CPython extensions.
https://jyni.12hp.de
Other
152 stars 17 forks source link

'getset_descriptor' object is not callable at 1668:0 in defchararray.py #18

Closed awmartin closed 7 years ago

awmartin commented 7 years ago

The error I'm getting when running:

import numpy as np

is:

TypeError: Error when calling the metaclass bases
    'getset_descriptor' object is not callable at 1668:0 in defchararray.py

This occurs with the following setup:

What can I do to help troubleshoot further? Am I missing a dependency?

Stewori commented 7 years ago

There should be no further dependency. Last time when I was able to test on a mac this worked well, but we had some initial trouble to let it find the "right" numpy. I.e. the system seems to ship its own Python in a way that hindered proper use of pip etc.. So, at first, please ensure that actually numpy 13.1 is on Jython's pythonpath, not a system/preinstalled numpy whatsoever. How did you configure sys.path? Please print out sys.path right before import numpy and ensure that itcontains the numpy you expected.

How did you launch Jython? Could you please provide the command line?

Also, the full stacktrace would be helpful.

Did you build numpy yourself or use prebuild binaries? Did you use JyNI binaries or did you build it yourself? Does JyNI work in principle, i.e. with the DemoExtension?

Stewori commented 7 years ago

In case you built NumPy by yourself, make sure you did not use Cython 0.27. See https://github.com/numpy/numpy/issues/9786 and https://github.com/Stewori/JyNI/issues/20.

awmartin commented 7 years ago

I got it to work!

Sorry about the distraction. I was attempting to package JyNI.jar into Python Mode of Processing.org to import numpy for interactive data science visualizations, which is powered by Jython 2.7.1.

After understanding a bit more about specifying the classpath and sys.path, I managed to successfully modify the ant build config and build numpy 1.13.1 properly.

I hope I can lobby for (or even help with) pandas support as well. Thanks so much!