pyqt5解决This application failed to start because it could not find or load the Qt platform plugin “xcb”.
bug提示信息
This application failed to start because it could not find or load the Qt platform plugin “xcb”.
Available platform plugins are: linuxfb, minimal, offscreen, xcb.
Reinstalling the application may fix this problem. Aborted (core dumped)
问题定位
- 定位
xcb的路径,通过ldd指令查看xcb库的依赖库状况。这里我们在执行ldd ~/miniconda3/lib/python3.7/site-packages/PyQt5/Qt/plugins/platforms/libqxcb.so出现了一条信息:libxkbcommon-x11.so.0 => not found。

问题原因
在Qt-5.12.1更新日志中描述:xkbcommon库被移除,因为基本所以的平台中都默认有这个库了。
[QTBUG-65503] Removed xkbcommon from bundled sources. This library is present on all supported platforms. The minimal required version now is 0.5.0.
解决方案
手动安装libxkbcommon-x11.so.0库即可。
在这里提供ubuntu系统对应的安装指令: sudo apt-get install libxkbcommon-x11-0.

本文解决PyQt5启动失败的问题,错误提示找不到或加载xcb插件。通过ldd指令定位到缺少libxkbcommon-x11.so.0库,提供Ubuntu下安装该库的解决方案。
2万+

被折叠的 条评论
为什么被折叠?



