本文共 1794 字,大约阅读时间需要 5 分钟。
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-pythonpip3 install opencv-python==4.3.0.36
然后检查此时的opencv版本,输入命令行:
python3 -c "import cv2; print(cv2.__version__)"
安装成功,显示
4.3.0
于是,我再次运行之前的代码,问题得以解决!记录!!!
转载地址:http://wetki.baihongyu.com/