利用matplotlib库画图的时候,报如下错误:
qt.qpa.plugin: Could not load the Qt platform plugin “xcb” in “./plugins/platforms” 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.
已放弃 (核心已转储)
-
尝试删除pyqt5后再重新安装。没解决。
-
尝试修改各种路径信息,但是经过确认路径信息都是对的。没解决。
-
尝试安装各种依赖。没解决。
-
最后!!删除python已安装库中重复的pyqt5,成功!!!具体步骤如下:
- (非必须,如果你的环境有用conda隔开的话)
conda activate xxx
(你的环境名) pip list
(查看PyQt5是否有重复。我这里是同时出现了PyQt5和PyQt5-sip)- (如果确实存在重复的pyqt5)
pip uninstall PyQt5
done!
- (非必须,如果你的环境有用conda隔开的话)