PyQT5错误:找不到或加载Qt平台插件xcb [英] PyQT5 error: could not find or load Qt platform plugin xcb

查看:874
本文介绍了PyQT5错误:找不到或加载Qt平台插件xcb的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

RedHat 6.5工作站上重新安装Anaconda3(包含Python 3.4)之前,我已经能够开发使用PyQT5的Python应用.

Up until Anaconda3 (which contains Python 3.4) was re-installed on my RedHat 6.5 workstation, I have been able to develop Python apps that use PyQT5.

重新安装Anaconda后,我收到一条错误消息:

Post re-install of Anaconda I receive an error message:

....找不到或加载Qt平台插件xcb

....could not find or load Qt platform plugin xcb

Anaconda安装之间的唯一区别是文件夹名称:/usr/local/ananaconda3/usr/local/anaconda_py3

The only difference between Anaconda installs is the folder name: /usr/local/ananaconda3 vs /usr/local/anaconda_py3

我检查了libqxcb.so没有缺少的依赖关系. 我重建了PyQT5. 我尝试显式添加PyQT5site-packages的位置:

I checked libqxcb.so has no missing dependencies. I rebuilt PyQT5. I tried explicitly adding location of site-packages of PyQT5:

import site
site.addsitedir("...path.../python3.4")

还有其他建议吗?

重新安装Python如何影响PyQT5的使用?

How does re-installing Python impact the use of PyQT5?

推荐答案

这是由于在同一安装/环境下使用两个不同版本的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.X.X,则将其删除(假设您想在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

这篇关于PyQT5错误:找不到或加载Qt平台插件xcb的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆