Uuntu20.04出现“qt.qpa.plugin: Could not load the Qt platform plugin “xcb” in
…出现“已放弃 (核心已转储)”这种问题:
解决方案是:更换opencv版本
Got keys from plugin meta data ("webgl")
QFactoryLoader::QFactoryLoader() looking at "/home/CCC/.local/lib/python3.8/site-packages/PyQt5/Qt/plugins/platforms/libqxcb.so"
Found metadata in lib /home/camila/.local/lib/python3.8/site-packages/PyQt5/Qt/plugins/platforms/libqxcb.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"xcb"
]
},
"archreq": 0,
"className": "QXcbIntegrationPlugin",
"debug": false,
"version": 331520
}
Got keys from plugin meta data ("xcb")
QFactoryLoader::QFactoryLoader() checking directory path "/home/CCC/anaconda3/envs/xxxxx/bin/platforms" ...
loaded library "/home/CCC/anaconda3/envs/xxxxx/lib/python3.8/site-packages/cv2/qt/plugins/platforms/libqxcb.so"
QObject::moveToThread: Current thread (0x555bac942790) is not the object's thread (0x555c47a16c60).
Cannot move to target thread (0x555bac942790)
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/home/CCC/anaconda3/envs/xxxxx/lib/python3.8/site-packages/cv2/qt/plugins" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: xcb, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl.
已放弃 (核心已转储)
我一度以为是安装pyqt安装出现了问题,甚至一度想卸载重装,后来查阅各种资料,发现有可能是我安装的opencv4.5.0版本过高,于是卸载重新安装了opencv4.3.0,问题得解!
pip3 uninstall opencv-python
pip3 install opencv-python==4.3.0.36
然后检查此时的opencv版本,输入命令行:
python3 -c "import cv2; print(cv2.__version__)"
安装成功,显示
4.3.0
于是,我再次运行之前的代码,问题得以解决!记录!!!
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
文章由极客之音整理,本文链接:https://www.bmabk.com/index.php/post/99865.html