pyinstaller 打包的可执行程序运行出错ImportError: /tmp/_MEIICfyah/libX11.so.6: undefined symbol: xcb_poll_for_rep

pyinstaller 打包的执行文件在另一台机子上运行出错,错误如下:

[root@hubrhel# ./main 
Traceback (most recent call last):
  File "main.py", line 1, in <module>
  File "/usr/local/lib/python3.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 627, in exec_module
  File "tkinter/__init__.py", line 36, in <module>
ImportError: /tmp/_MEIICfyah/libX11.so.6: undefined symbol: xcb_poll_for_reply64
[13720] Failed to execute script main
 

解决方式如下:

Pyinstaller excludes the libxcb libraries. Check PyInstaller/depend/dylib.py - there you will find:

libxcb changes ABI frequently (e.g.: between Ubuntu LTS releases) and is libxcb-dri changes ABI frequently (e.g.: between Ubuntu LTS releases) and is usually installed as dependency of the graphics stack anyway. No need to bundle it.

... or check this commit, which has not made it into pyinstaller yet:https://github.com/pyinstaller/pyinstaller/commit/4a6d74a13122b763e99f97995fbbb1c6967769bb

Try to remove "r'/libxcb.so..*': 1," in PyInstaller/depend/dylib.py.

去除PyInstaller/depend/dylib.py文件中的libxcb.so相关的两个库    r'libxcb\.so(\..*)?',r'libxcb-dri.*\.so(\..*)?'

然后重启设备,重新进行打包。程序运行正常。

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值