项目场景:
在使用pyqt5出现问题,让人真的很头疼哇
问题描述
具体问题如下:
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, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.
解决方案:
提示:首先 添加环境变量,export QT_DEBUG_PLUGINS=1, 然后 cd到要运行的文件的目录下,在conda环境中使用python,来运行该文件,这个时候,报错的信息比较详细,具体错误如下:
然后,就发现不是包本身的问题,是使用远程服务器的问题,那么问题怎么解决呢?
1、下载 xshell 、 xming
2、 配置参考链接1 配置参考连接2
3、运行,就OK了