我正在尝试运行一个依赖于Qt的python模块,它给了我这个错误:
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.
在启用QT_DEBUG_PLUGINS的情况下再深入挖掘一下,我得到了这个错误:
Cannot load library /r1/people/Jonas_P/.conda/envs/playground/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so: (/r1/people/Jonas_P/.conda/envs/playground/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/../../lib/libQt5XcbQpa.so.5: undefined symbol: _ZN23QPlatformVulkanInstance22presentAboutToBeQueuedEP7QWindow, version Qt_5_PRIVATE_API)
QLibraryPrivate::loadPlugin failed on "/r1/people/Jonas_P/.conda/envs/playground/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so" : "Cannot load library /r1/people/Jonas_P/.conda/envs/playground/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so: (/r1/people/Jonas_P/.conda/envs/playground/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/../../lib/libQt5XcbQpa.so.5: undefined symbol: _ZN23QPlatformVulkanInstance22presentAboutToBeQueuedEP7QWindow, version Qt_5_PRIVATE_API)"
我已经卸载了我能找到的任何版本的pyqt。使用anaconda重新安装pyqt或使用pip重新安装pyqt5不会导致任何更改。
不幸的是,我是在HPC上,所以我没有root来安装conda环境之外的任何东西。
我通过将pyqt5安装降级到依赖于它的python模块(ete3,发布于2020年8月)发布时发布的最新版本来修复它。
以后参考:
pip install --upgrade pyqt5==5.15.0