Skip to content
Advertisement

Running compiled Linux executable on other Linux computers

I’ve been working on a custom program that allows me to control my other Linux-based computers on my network. I’ve been using Python and used PyInstaller to compile the code into a Linux executable. Running the executable on my own computer works just fine and does exactly what it’s supposed to. But once I send it over to another computer to test it, I get this error.

ImportError: /lib/x86_64-linux-gnu/libc.so.6: version 'GLIBC_2.25' not found (required by /tmp/_MEIXcUz91/libudev.so.1)
[3716] Failed to execute script RP

And the command I used to compile the code with PyInstaller

python pyinstaller.py -D -F -n RP -c RP.py

Again, the executable runs perfectly on the computer I used to create and compile it, but once I send it over to my other Linux-based computer and execute it, it crashes.

Advertisement

Answer

The problem is that you have different C system libraries on the two machines. There can sometimes be difficulties when porting a pre-built binary. Either you ensure that you’re using a similar environment or you put all dependencies into the binary – this may increase its size significantly. To do the latter you need to use the ´–static´ keyword during compilation. I’m not sure, though, whether this is enough.

EDIT:

Since this is a pure Python project, you should make sure that the used Python version is compatible, i.e., same Python version and also the same Python build (CPython, etc.).

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement