Search code examples
pythonubuntupyinstallerglibc

Error loading Python lib libpython3.6m.so.1.0 pyinstaller Ubuntu Python


I have done pyqt5 python project on ubuntu 18.04. I have compiled the python project into executable using pyinstaller pyinstaller app.py. I have then copied all the files from dist directory to another machine which is running ubuntu 16.04. When running the application, it gives me below error:

[4810] Error loading Python lib '/home/andrew/Documents/OPC/libpython3.6m.so.1.0': dlopen: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.25' not found (required by /home/andrew/Documents/OPC/libpython3.6m.so.1.0)

I am not able to understand this error. I have checked that the file libpython3.6m.so.1.0 is present in the directory. My next point is on GLIBC. I think in ubuntu 18, the version of GLIBC is 2.27 and the version of GLIBC in ubuntu 16 is 2.23.

I think because of this version issue, this error is coming. I tried looking for answer on how to upgrade the GLIBC but it is mentioned that, it is not recommended to update it and it can be a bit risky topic1 topic2

Should I not update GLIBC. How can I resolve this issue. Please help. Thanks


Solution

  • If you want to run your application on Ubuntu 16, you have to compile it on Ubuntu 16. In general, for compatibility reasons, you need to build on the oldest distribution you want to support. Most distributions offer some backwards compatibility during upgrades, possibly using compatibility packages, so that old applications continue to run. But there is no forward compatibility, in the sense that old distributions can run code compiled on newer distributions.