A PyInstaller app says GLIBC not found on another Linux machine
version `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.
Fix it fast
1Find out which cause you have
Compare the glibc version on the build machine and on the machine that fails.
ldd --version | head -n 12Match what you see, then jump to its fix
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 12Fix
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.py3Verify
Run the new binary on the machine that failed.
./dist/appConfirmed by pyinstaller.org
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/app2Fix
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.py3Verify
file reports the same architecture as the target, and the binary starts.
file dist/app && ./dist/appConfirmed by pyinstaller.org
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:
- stegnor.comMy company site: 804 pages from a Python and Jinja generator, with 15 free browser tools.
- MenuloA restaurant discovery platform in Germany, kept current by a Python ingestion pipeline.
- ShopGoAn e-commerce aggregator with a Python scraping engine behind its catalog, past 10K Google Play downloads.
Related fixes
Servers
pip install confluent-kafka fails because librdkafka/rdkafka.h is missing
pip stops while building confluent-kafka from source
The error means pip is compiling confluent-kafka from source, and the compiler cannot find the librdkafka C headers.
3 causes, each with a fixServers
cv2.imshow raises 'not implemented' because the wrong OpenCV package is installed
cv2.imshow() works in one environment and fails in another
The headless OpenCV packages are built without any GUI code, so cv2.imshow cannot open a window.
2 causes, each with a fixServers
pip install Cython succeeded, but the shell cannot find cythonize
a pip warning that a script was installed to a directory outside PATH
pip put the cythonize script in a folder your shell does not search.
3 causes, each with a fixServers
Django returns a 500 behind Gunicorn and the traceback is nowhere
The traceback shows locally with runserver but not under Gunicorn
With DEBUG set to False, Django's default logging does not print errors to the console.
2 causes, each with a fixServers
Docker build fails with apk: not found in a Python or Ubuntu image
/bin/sh: 1: apk: not found
apk is the package manager of Alpine Linux only.
2 causes, each with a fixServers
You cannot pip install packages inside an Ubuntu Docker container
error: externally-managed-environment
If pip is missing, install the python3-pip package with apt, in the same RUN as apt-get update.
3 causes, each with a fix