Closed Adamatoma closed 2 years ago
You need to verify that all the related components are built for the same architecture. The error suggests that your Java, Python, and Jep library are built for one architecture while your numpy library is built for a different, incompatible architecture. I suspect you are running an arm based mac with an x86-64 version of Java. Depending on whether you want to be running the program with arm or x86-64 you may need to install an arm version of Java or an x86-64 version of numpy. Whichever architecture you choose you will also need compatible versions of python and jep.
Hi Ben, thanks for your reply, which is really helpful!
I guess my problem would be incompatible of x86-64 Java with ARM numpy.
That explains why python 3.6.5 works fine while 3.10.5 fails.
python 3.10.5 gives me a "universal2 installer", which is a python version for ARM i guess.
python 3.6.5 is a x86-64 version
Are these correct?
I do not have a mac and I am not an expert on mac. It is my understanding that the universal2 installer is compatible with both arm64 and x86_64 macs, each executable and binary contains the compiled code for both and the correct version is selected when you use it. Numpy is distributing separate wheels for x86_64 and arm64.
When you run python or pip from the command line I assume the OS will pick the arm64 version over x86_64 since arm64 is more nativer. If that is the case then it makes sense for pip to choose the arm64 version of numpy.
When you include python from a java application, the x86_64 version of python will be used because that is the only version compatible with your x86_64 version of java.
If this is a correct analysis then you need to either get an arm64 version of java or you need to force pip to install the x86_64 version of numpy. I believe if you manually download the x86_64 wheel for numpy you will be able to install that wheel locally using pip.
Thanks Ben, Problem solved, works well! Cheers!
Describe the problem import numpy failed when i got jep(4.0.3) and numpy(1.23.1) in python (3.10.5) installed cmd:
python3 -m pip install numpy python3 -m pip install jep
then go to jep run:import numpy
will get follow issue:Search for existing solutions I look through some relevant topic on Google Jep Project Forum but haven't solve my problem. https://groups.google.com/g/jep-project/c/WEIxatC1Kfs/m/IUE7lVzqAgAJ https://groups.google.com/g/jep-project/c/GX-Oq2ZbXeE/m/zm4DeKiKBwAJ
Environment (please complete the following information):
Logs Please attach the complete console output of the build.
Additional context python 3.6.5 works fine, so i guess it might be some compatible problem.