-
Notifications
You must be signed in to change notification settings - Fork 150
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
Jep does not pip install with numpy support for Ubuntu 24.04, Python 3.12, pip 24.0 #566
Comments
Does #562 solve this for you? |
Hi Ben, I will build and test that shortly. I just checked, and it is not specific to numpy 2, When I first caught the problem the install was using numpy 1.26.4. I'll post me results shortly. Thanks! |
I downloaded jep, switched to dev_4.2 and installed jep in a fresh venv with numpy 2.1.1 and it still fails:
I double checked with numpy==26.4 and got the same result. |
Here's an interesting test. Still using 24.04, but I used python 3.10 instead, and then tweaked the version of pip in use. The failure occurs when going from pip 23 to 24.
|
One other nugget. When installing using the old version of pip, it gives this deprecation warning:
This makes me wonder if it fails when it builds a wheel for the install ( |
Hi Ben. I've been debugging this using the --verbose flag for pip install and adding print statements to setup.py to see if I can figure out what is happening. What I found is very strange. setup.py is failing on the try block starting at line 30. It is the import of numpy that fails, so it never even gets to the new path you added in dev_4.2. I am totally perplexed, as my steps have been:
This makes no sense to me at all, as I can manually start python in the venv and import numpy without any problem. I am going to test some more and I will update you with what I find. Thanks. |
If it helps, here's the stack trace:
|
Update: I have been able to get past this problem by pip installing both "wheel" and "setuptools" before pip installing jep. I am still not able to build with numpy support, but I have a lead and am chasing that down now. |
I have not been able to recreate this problem in my test environment. I've tried both python 3.12 and 3.13-rc with pip 24.2. I do need to install setuptools before jep but without setuptools it doesn't disable numpy support, it just fails completely. I do not need to install wheel. |
My test case builds fine with either setuptools or wheel (or both) missing and then does not support numpy. It does not crash as in your case. That could easily be attributed to any number of things, so I am not going to worry about it. I still cannot get my simple test case to work with numpy support, so I think I have made some kind of error. But, the good news is: my original application (which is way more complicated) now works fine! And, in that case, all I needed was to add setuptools, just like you did, I did not need to add wheel. OK, I think all that is required is setuptools and everything seems to work fine. I will hold off upgrading to numpy 2.X until you all do another release (4.3?). Thanks very much for your help! -Erik |
When pip-installing numpy followed by jep on a new virtual env, the installed version of jep does not support numpy (jep.JEP_NUMPY_ENABLED == 0). I suspect this is somehow related to pyproject.toml vs setup.py, which seems to be determined by the version of pip being used, but have not been able to prove it.
I discovered this by upgrading an existing system using Mint 21.3 (Ubuntu 22.04), Jep 4.2.0 and Python 3.10, which supports numpy just fine. Switching between python 3.10 and 3.12 verified the problem. As a result of jep.JEP_NUMPY_ENABLED being 0, Java arrays are no longer translated into numpy arrays and arrive in python as Jep.NDArrays.
Log of venv creation, numpy and jep pip install:
jep_build.txt
Test program:
TestJepNumpySupport.java.txt
Test output:
test_output.txt
Any guidance is appreciated and I am more than happy to test or debug any possible solutions.
Thanks!
Erik
The text was updated successfully, but these errors were encountered: