ninia / jep

Embed Python in Java
Other
1.32k stars 150 forks source link

Installing jep on M1 Machine. With error incompatible architecture (have 'arm64', need 'x86_64')) #379

Closed plapa closed 2 years ago

plapa commented 2 years ago

Describe the problem A clear and concise description of what the problem is.

I'm not able to run jep commands on a M1 machine.

Search for existing solutions The Jep build is automatically tested and confirmed to be working in Linux, OS X, and Windows using Travis and AppVeyor. We cannot possibly test every environment so we rely on the community to document any issues and solutions in other environments. Please search for a similar problem and solution on both the mailing list and the existing closed github issues before opening a new issue.

Environment (please complete the following information):

Logs Please attach the complete console output of the build. running jep

produces this output:

java.lang.UnsatisfiedLinkError: /Users/plapa/miniforge3/lib/python3.9/site-packages/jep/jep.cpython-39-darwin.so: dlopen(/Users/plapa/miniforge3/lib/python3.9/site-packages/jep/jep.cpython-39-darwin.so, 0x0001): tried: '/Users/plapa/miniforge3/lib/python3.9/site-packages/jep/jep.cpython-39-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/lib/jep.cpython-39-darwin.so' (no such file)

Additional context Add any other context about the problem here.

I tried installing jep from Pypy. But also by downloading version 4.0.2 and running the following command:

`` ARCHFLAGS="-arch arm64" python3 setup.py build install

bsteffensmeier commented 2 years ago

It appears you are using a java built for x86_64 and python built for arm64. Both java and python need to be built for the same architecture to use jep. You will need to acquire an arm64 build of java or an x86_64 build of python and ensure you are using the correct, compatible versions when running jep.

plapa commented 2 years ago

Thank you so much for the help! Installing a java 11 jdk for aarm64 seems to have solved the problem.

I used this jdk: https://www.azul.com/downloads/?version=java-11-lts&os=macos&architecture=arm-64-bit&package=jdk