记录自己的报错及解决过程:
报错:qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
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, xcb.
————————————————
解决:
1.
修改配置文件~/.bashrc:
(在xshell里的隐藏文件下可以找到)
在最后增加export QT_DEBUG_PLUGINS=1
这样,会在刚才的程序启动时,列出详细的错误提示。
QFactoryLoader::QFactoryLoader() checking directory path "/home/YYF/.conda/envs/gmxMMPBSA/bin/platforms" ...
Cannot load library /home/YYF/.conda/envs/gmxMMPBSA/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so: (libxcb-image.so.0: cannot open shared object file: No such file or directory)
QLibraryPrivate::loadPlugin failed on "/home/YYF/.conda/envs/gmxMMPBSA/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so" : "Cannot load library /home/YYF/.conda/envs/gmxMMPBSA/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so: (libxcb-image.so.0: cannot open shared object file: No such file or directory)"
2.
输入:ldd libqxcb.so,查看是否存在缺失的库文件。
缺失的库文件,会提示:not found,如:
libxcb-image.so.0 => not found
libxcb-keysyms.so.1 => not found
libxcb-image.so.0 => not found
libxcb-keysyms.so.1 => not found
3.
若发现不存在libxcb-xinerama.so.0库,解决办法:
yum install libxcb-xinerama0
若发现不存在libxcb-render-util.so.0库,解决办法:
yum install xcb-util-renderutil
若发现不存在libxcb-image.so.0库,解决办法:
yum install xcb-util-image
若发现不存在libxcb-icccm.so.4库,解决办法:
yum install xcb-util-wm
若发现不存在libxcb-keysyms.so.1库,解决办法:
yum install xcb-util-keysyms