问题描述
Linux下使用虚拟环境中的labelme,会出现 Could not load the Qt platform plugin "xcb" in "" even though it was found.
全部报错代码
以下是虚拟环境打开labelme全部报错代码
qt.qpa.xcb: could not connect to display
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.
Abort (Core dumped)
解决方法
在该虚拟环境下安装pyqt5 5.12.0版本即可
pip install pyqt5==5.12.0
问题本质
5.12.0(512这个版本比较稳定),建议安装此版本,仅此记录踩过的坑。