klamt-lab / straindesign

StrainDesign is a python package for the computational design of metabolic networks and based on COBRApy
Apache License 2.0
33 stars 6 forks source link

Issue with the JVM DLL #7

Closed tylerautera closed 1 year ago

tylerautera commented 1 year ago

Hello,

I am running into an issue with JVM and wanted to see if there was someone else who ran into the issue. I am trying to use straindesign in a python3.9 application. As the install instructions mentioned -- I did receive this error:

JVMNotFoundException: No JVM shared library file (libjli.dylib) found. Try setting up the JAVA_HOME environment variable. Turns out I did not have Java JDK installed on my Macbook Pro. So I installed JDK 19. And then set the environment variable as suggested in the straindesign docs.

However, even though it is now able to locate the JVM shared library file, it is erroring saying the JVM DLL is not found. [Errno 0] JVM DLL not found: /Library/Java/JavaVirtualMachines/jdk-19.jdk/Contents/Home/lib/libjli.dylib

I have tried installing JDK 17 as well with the same error.

VonAlphaBisZulu commented 1 year ago

Hi Tyler, DLLs are Windows libraries, so I wouldn't expect them on OS X. Unfortunally, I don't have OS X and thus cannot debug your problem myself. But maybe this helps: Straindesign uses the Java implementation of efmtool which requires Jpype. Other users reported your error when they tried to use JPype under OS X issue #994 and got it working somehow. Hope this helps All the best

tylerautera commented 1 year ago

Thanks @VonAlphaBisZulu I had seen this issue but thought I would ask here whether there was a more straight forward fix. Though, it does seem to have the answer in that open issue.

Essentially, If you are running an M1 chip -- even though the ARM version of JDK is made for the M1 chip -- seems there is compatibility issues with JPype /Python. Once I installed the the x86 build of JDK (my computer complained that it was suboptimal and there may be issues), I stopped getting the error.

VonAlphaBisZulu commented 1 year ago

Thank you for sharing the fix!