Hello everyone,
I would like to create an executable of my python code using PyInstaller.
Unfortunately, I am having some poblems creating the executable. This is what I have done step by step to create the .exe file:
-
I created a miniconda environment within which I installed the Orekit Python Wrapper together with PyIntsaller, and all the other packages requested by the code.
-
The executable is created by running the code:
pyinstaller --onefile my_file.py
At this point, it is created a dist/
folder within which I have the executable file my_file.exe
. As a try to run the file I got an error message:
Error occurred during initialization of VM
Unable to load native library: libverify.so: cannot open shared object file: No such file or directory
I saw in PyInstaller documentation that additional data and dependencies can be added by editing the .spec
file which is created during the executable making process.
- I found the native library
libverify.so
in thejre
folder of my environment at./my_env/jre/lib/amd64
, and I added its path to the.spec
file:
a = Analysis(…
binaries=[ ( ‘./my_env/jre/lib/amd64/libverify.so’, ‘.’ ) ],
- When I try to execute the .exe file again it now prints the following error:
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object
It seems that there is a problem with JAVA and the initialization of the Virtual Machine called with vm = orekit.initVM()
.
Anyone knows how to solve that issue?
If it can be useful, I am currently using Ubuntu 22.04.2 LTS Linux distribution.
Thank you in advance,
Giulio