You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to package a CLI app as a Linux standalone executable using PyInstaller. I don't have a Linux OS so I used Vagrant to package it; used the CentOS 7 box since the server where the executable will run is also CentOS 7.
I was able to create a standalone executable and it ran successfully with a fresh CentOS 7 Vagrant machine (no provisioning scripts / no python3 and its dependencies installed).
But when I run the executable in the server, it gives me this error:
[user@server ~]$ emails_automation/emails --help
[22874] Error -3 from inflate: unknown compression method
[22874] Error decompressing _asyncio.cpython-38-x86_64-linux-gnu.so
Failed to write all bytes for _asyncio.cpython-38-x86_64-linux-gnu.so
fwrite: Bad address
Some Observations
✅ Both VM and the actual server has the same glibc version:
🤔 Searching for "inflate: unknown compression method" in the pyinstaller repo and returned files related to zlib. So I checked whether zlib is installed in both the server and the fresh CentOS 7 VM (the one without any provisioning scripts). I ran the python REPL and both doesn't give import errors which tells me zlib is installed.
VM:
[vagrant@localhost ~]$ python
Python 2.7.5 (default, Apr 2 2020, 13:16:51)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux2
Type "help", "copyright", "credits" or "license"for more information.
>>> import zlib
>>> zlib.crc32
<built-in functioncrc32>
Server:
[user@server ~]$ python
Python 2.7.5 (default, Nov 16 2020, 22:23:17)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux2
Type "help", "copyright", "credits" or "license"for more information.
>>> import zlib
>>> zlib.crc32
<built-in functioncrc32>
What could be causing this? I know that PyInstaller doesn't do cross-compilation. Is it because I'm using a virtual machine to package it?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm trying to package a CLI app as a Linux standalone executable using PyInstaller. I don't have a Linux OS so I used Vagrant to package it; used the CentOS 7 box since the server where the executable will run is also CentOS 7.
I was able to create a standalone executable and it ran successfully with a fresh CentOS 7 Vagrant machine (no provisioning scripts / no python3 and its dependencies installed).
But when I run the executable in the server, it gives me this error:
Some Observations
✅ Both VM and the actual server has the same glibc version:
VM:
[root@localhost emails]# ldd --version ldd (GNU libc) 2.17
Server:
[user@server ~]$ ldd --version ldd (GNU libc) 2.17
🤔 Searching for "inflate: unknown compression method" in the pyinstaller repo and returned files related to
zlib
. So I checked whether zlib is installed in both the server and the fresh CentOS 7 VM (the one without any provisioning scripts). I ran the python REPL and both doesn't give import errors which tells me zlib is installed.VM:
Server:
What could be causing this? I know that PyInstaller doesn't do cross-compilation. Is it because I'm using a virtual machine to package it?
Beta Was this translation helpful? Give feedback.
All reactions