美文网首页
PyInstaller

PyInstaller

作者: 87d6dc4b11a7 | 来源:发表于2023-12-06 15:25 被阅读0次

问题:在一台服务器上执行pyInstaller进行打包,然后拷贝到另一台服务器上后,执行报如下错误。

[212327] Error loading Python lib '/tmp/_MEIyobu1r/libpython3.8.so.1.0': dlopen: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /tmp/_MEIyobu1r/libpython3.8.so.1.0)

原因是:打包时的GLIBC是高版本,因此打包出来的可执行文件所依赖的也是高版本,所以在GLIBC低版本的 Linux系统中就无法执行。

解决:参考官方文档,在低版本的机器上进行构建。

如何查看GLIBC版本?

ldd --version
getconf GNU_LIBC_VERSION
strings /lib/x86_64-linux-gnu/libc.so.6 | grep GLIBC

升级GLIBC

sudo apt-get update
sudo apt-get install libc6

相关文章

网友评论

      本文标题:PyInstaller

      本文链接:https://www.haomeiwen.com/subject/ichjgdtx.html