How to get a jep build with numpy support

215 views
Skip to first unread message

Eric Hansen

unread,
Feb 15, 2021, 9:56:32 AM2/15/21
to Jep Project

I've just started getting errors in my jep process where the NDArray I'm setting on the python interpreter is not being used in the script as an ndarray.  Specifically, the python code is generating the below exception when executing "np.hstack([matrix_4x3, np.ones((matrix_4x3.shape[0], 1))])".

      jep.JepException: <class 'AttributeError'>: 'jep.PyJObject' object has no attribute 'shape'

this happening both when running from source code and in my docker containers.  numpy and jep are being installed using pip:

      python -m pip install numpy
      python -m pip install jep

The dockerfile has not changed nor has the python module, but it is failing now.  jep.JEP_NUMPY_ENABLED is returning 0 and I've seen in other posts that this probably needs to be 1.  

How do I get numpy support back.  I've never had to build jep manually, pip install has always worked until now.

Thanks for any suggestions.

Eric Hansen

unread,
Feb 15, 2021, 1:06:06 PM2/15/21
to Jep Project
The plot thickens...
The same image/container running on different Linux host does not fail. 
What could be different on the host that would change how jep loads in a container?

Ben Steffensmeier

unread,
Feb 15, 2021, 7:45:22 PM2/15/21
to Jep Project
setup.py will be run during the install and there is a little bit of python code that detects if numpy is installed. If numpy is installed then jep is built with numpy support. The pip install should be running setup.py I recommend looking at the output of the pip command to verify setup.py is running and see if numpy is found or not. if numpy is not found you can try starting python from the command line and investigate why numpy isn't available.

Ben

Eric Hansen

unread,
Feb 16, 2021, 9:44:11 AM2/16/21
to Ben Steffensmeier, Jep Project
Thanks Ben, that all makes sense. 
I did try to re-install, but I don’t think pip uninstall gets rid of everything so running pip install just put the same build back.
Eric-
--
You received this message because you are subscribed to a topic in the Google Groups "Jep Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jep-project/WEIxatC1Kfs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jep-project...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jep-project/9fb127d6-2a79-414e-b795-73593acc6bf0n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages