Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Servers, nginx and Docker

A PyInstaller app says GLIBC not found on another Linux machine

Errorversion `GLIBC_2.35' not found (required by /tmp/_MEIqx6YRS/libpython3.10.so.1.0)

Short answer

PyInstaller does not bundle libc. Your binary links to the glibc of the machine that built it, so it cannot run on a machine with an older glibc. Build the app on the oldest Linux release you want to support, and build separately for each platform and word size.

  • Applies to PyInstaller 6, Ubuntu 22.04 and 24.04, Python 3.10-3.12
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Compare the glibc version on the build machine and on the machine that fails.

    ldd --version | head -n 1
  2. 2Match what you see, then jump to its fix

    1. 1The required GLIBC version is higher than what ldd --version reports on the targetThe app was built on a newer Linux than the one running itFix
    2. 2The binary was built on another OS, or a 32-bit build runs on 64-bit (or the reverse)The binary was built for a different platform or word sizeFix

What does the error look like?

  • version `GLIBC_2.35' not found (required by /tmp/_MEIqx6YRS/libpython3.10.so.1.0)

Cause 1 of 2

The app was built on a newer Linux than the one running it

1Check

The PyInstaller docs say the app links to the host's libc and that the libc interface is forward compatible only: newer systems run old builds, not the other way round.

# on the build machine, then on the failing machine
ldd --version | head -n 1

2Fix

Rebuild on the oldest GNU/Linux release you mean to support, for example in a container or VM of that release, then ship that result.

# inside the older OS image or VM
pip install pyinstaller
pyinstaller --onefile app.py

3Verify

Run the new binary on the machine that failed.

./dist/app

Confirmed by pyinstaller.org

Did this fix it?

Cause 2 of 2

The binary was built for a different platform or word size

1Check

The docs say you must install PyInstaller and bundle the app on each platform separately, and that 32-bit and 64-bit builds are not interchangeable.

uname -m
file dist/app

2Fix

Build on each target OS and architecture, using a separate virtual environment or VM per Python version or platform.

python3 -m venv .venv
.venv/bin/pip install pyinstaller
.venv/bin/pyinstaller --onefile app.py

3Verify

file reports the same architecture as the target, and the binary starts.

file dist/app && ./dist/app

Confirmed by pyinstaller.org

Did this fix it?

How do I stop it coming back?

  • Make CI build release binaries in an image of the oldest Linux you support, not on the newest runner.
  • Keep one build job per OS and architecture.
  • Note the build OS next to every release, so a glibc mismatch is easy to read from the error.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.