PyQT5错误:找不到或加载Qt平台插件xcb [英] PyQT5 error: could not find or load Qt platform plugin 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
.
我尝试显式添加PyQT5
的site-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
如果同时看到pyqt
和qt
都具有版本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屋!