PyQT5 错误:无法找到或加载 Qt 平台插件 xcb [英] PyQT5 error: could not find or load Qt platform plugin xcb
问题描述
直到 Anaconda3
(包含 Python 3.4
)重新安装在我的 RedHat 6.5
工作站上,我已经能够开发 Python使用 PyQT5
的应用.
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/anaconda3
vs /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.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
这篇关于PyQT5 错误:无法找到或加载 Qt 平台插件 xcb的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!