且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

PyQT5 错误:无法找到或加载 Qt 平台插件 xcb

更新时间:2022-06-02 21:08:20

这是由于同一安装/环境下有两个不同版本的Qt导致的错误.

This is an error caused by having two different versions of Qt under the same installation/environment.

检查您的环境中安装的软件包及其版本(如果由于某种原因您不在虚拟环境中工作,您可以跳过第一行):

Check the packages installed and their versions in your environment (if for some reason you're not working in a virtual environment, you can skip the first line):

source activate yourenvname 
conda list

如果您看到 pyqtqt 都具有版本 4.XX 则删除它们(假设您想在 Qt v5 中工作):

If you see pyqt and qt both with version 4.X.X then remove them (assuming you want to work in Qt v5):

conda remove qt
conda remove pyqt