pythonpyinstallerexecutableglibcbusybox

Why can't I run my python executables in busybox?


The setup is as follows:

I have a device with very limited ressources and busybox is running on it. With PyInstaller I have built an executable out of my python script on a linux system with the same architecture. I know that the executables are compatible, there is no doubt. There is only one problem: The executable still does not run:

[37832] Error loading Python lib '/tmp/_MEIEmDggN/libpython3.11.so.1.0': dlopen: /usr/lib64/libm.so.6: version `GLIBC_2.35' not found (required by /tmp/_MEIEmDggN/libpython3.11.so.1.0)

I understand the error and wanted to find out which glibc version is installed, but I cant find out by any means.

ldd --version for example does not yield any results (ldd not found)

I know for sure that there is a c library installed, because there are other python executables running on there. How do I find out which one and what version? I want to built the executable with that specific version then.Building the executable on the device itself is not an option, it has very little storage and performance to always pull all the dependencies and bundle them.


Solution

  • There is only one problem: The executable still does not run

    The executable doesn't run because it requires (was linked against) GLIBC-2.35 (or newer) but is running on a machine with older version of GLIBC.

    This also has nothing to do with busybox.

    You must either:

    The second fix could be done by building Python in a chroot or a docker with appropriate (old) GLIBC.


    ldd --version for example does not yield any results (ldd not found)

    You can find which version you have without ldd -- just run /usr/lib64/libc.so.6 by itself and it will print its version.