Reputation: 291
I've python code and I've compressed it with PyInstaller 3.5. My dev. env is an Ubuntu 18.04 server but customer would like to run and use compressed python script on CentOS 7.6
I've got a feedback with error stack:
Traceback (most recent call last):
File "site-packages/PyInstaller/loader/rthooks/pyi_rth_certifi.py", line 11, in <module>
File "/tmp/pip-install-16KWaj/PyInstaller/PyInstaller/loader/pyimod03_importers.py", line 395, in load_module
File "ssl.py", line 98, in <module>
File "/tmp/pip-install-16KWaj/PyInstaller/PyInstaller/loader/pyimod03_importers.py", line 684, in load_module
ImportError: /usr/lib64/libc.so.6: version `GLIBC_2.25' not found (required by /tmp/_MEIhotjJf/libcrypto.so.1.1)
[22972] Failed to execute script pyi_rth_certifi
Does it mean that need to compress python code on CentOS 7.6 or is there any other problem? I've checked compressed code in my dev.environment and it run well...that's the reason why I think that OS difference could couse the error/problem.
Upvotes: 0
Views: 992
Reputation: 752
PyInstaller will only compile for the platform it is executed on. While both CentOS and Ubuntu are Linux distros, it doesn't mean they are built the same way! Some libs present on ubuntu might very well be missing from CentOS.
This theory is even more likely seeing that the compiled binary will run in your ubuntu but not in the CentOS. This, to me, suggests that there is nothing wrong with your compilation (no missing external files or incorrectly compiled dependencies) but that the /usr/lib64/libc.so.6: version `GLIBC_2.25' needed by the program and present on Ubuntu might not be present on CentOS.
Compiling the program on CentOS would most likely result in PyInstaller detecting this missing dependency and adding it to the compiled binary.
The first thing to test is to try running your python script on CentOS and seeing if that raises any errors in the IDE. If it doesn't then your next step is to try compiling directly on CentOS. If the script didn't raise an error then the compilation should work for that OS and so should the compressed output of PyInstaller.
Upvotes: 1