少添加了一个环境变量。QT_QPA_PLATFORM_PLUGIN_PATH
sudo gedit /etc/environment
在末尾加上
QT_QPA_PLATFORM_PLUGIN_PATH="/home/zyj/anaconda3/plugins/platforms"
这个文件夹是PYQT5 的 plugins文件夹。文件夹里内容大致跟下头的差不多。文件夹换成自己的。

https://github.com/pyqt/python-qt5/wiki/Qt-Environment-Variable-Reference
网友评论