qt.qpa.plugin: Could not load the Qt platform plugin “xcb“ in

在尝试运行应用时遇到了关于Qt平台插件的问题,错误显示无法加载xcb插件。已经尝试设置QT_DEBUG_PLUGINS环境变量来获取更详细的错误信息,发现多处非ELF对象导致的插件加载失败。尽管xcb插件被找到,但仍然无法初始化。解决方案可能包括重新安装相关应用或修复Qt库。
摘要由CSDN通过智能技术生成

兄弟们看看是不是这个错:

QObject::moveToThread: Current thread (0xe5205f0) is not the object's thread (0xa14d0f0).
Cannot move to target thread (0xe5205f0)

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/xxx/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.

VScode 80年不出个错,今儿冒出来这个,我也不知道是mmdet配置问题,还是opencv-python的问题,还是VScode的问题hhhh

参考该链接:
https://blog.csdn.net/LOVEmy134611/article/details/107212845

把QT的flag打开,我们才能看到报错的详细信息

export QT_DEBUG_PLUGINS=1

注意,这个执行后,该环境变量只在当前终端有效,关了这个终端就失效了,当然你也可以写到.bashrc

然后就整出一个超级长的报错:

QFactoryLoader::QFactoryLoader() checking directory path "xxxxminiconda3/envs/tor38/lib/python3.8/site-packages/cv2/qt/plugins" ...
QFactoryLoader::QFactoryLoader() checking directory path "xxxxminiconda3/envs/tor38/lib/python3.8/site-packages/PyQt5/Qt5/plugins" ...
QFactoryLoader::QFactoryLoader() checking directory path "xxxxminiconda3/envs/tor38/bin" ...
QFactoryLoader::QFactoryLoader() looking at "xxxxminiconda3/envs/tor38/bin/2to3"
QElfParser: 'xxxxminiconda3/envs/tor38/bin/2to3-3.8' is not an ELF object
"'xxxxminiconda3/envs/tor38/bin/2to3-3.8' is not an ELF object" 
 not a plugin
QFactoryLoader::QFactoryLoader() looking at "xxxxminiconda3/envs/tor38/bin/2to3-3.8"

......

QFactoryLoader::QFactoryLoader() looking at "xxxxminiconda3/envs/tor38/bin/yapf"
QElfParser: 'xxxxminiconda3/envs/tor38/bin/yapf' is not an ELF object
"'xxxxminiconda3/envs/tor38/bin/yapf' is not an ELF object" 
 not a plugin
QFactoryLoader::QFactoryLoader() looking at "xxxxminiconda3/envs/tor38/bin/yapf-diff"
QElfParser: 'xxxxminiconda3/envs/tor38/bin/yapf-diff' is not an ELF object
"'xxxxminiconda3/envs/tor38/bin/yapf-diff' is not an ELF object" 
 not a plugin
QFactoryLoader::QFactoryLoader() checking directory path "xxxxminiconda3/envs/tor38/lib/python3.8/site-packages/cv2/qt/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() looking at "xxxxminiconda3/envs/tor38/lib/python3.8/site-packages/cv2/qt/plugins/platforms/libqxcb.so"
Found metadata in lib xxxxminiconda3/envs/tor38/lib/python3.8/site-packages/cv2/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 ("webgl")
QFactoryLoader::QFactoryLoader() looking at "xxxxminiconda3/envs/tor38/lib/python3.8/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so"
Found metadata in lib xxxxminiconda3/envs/tor38/lib/python3.8/site-packages/PyQt5/Qt5/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 "xxxxminiconda3/envs/tor38/bin/platforms" ...
loaded library "xxxxminiconda3/envs/tor38/lib/python3.8/site-packages/cv2/qt/plugins/platforms/libqxcb.so"
QObject::moveToThread: Current thread (0x5eeb0e0) is not the object's thread (0xb291550).
Cannot move to target thread (0x5eeb0e0)

......


qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "xxxxminiconda3/envs/tor38/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.

参考该链接:
https://github.com/google/mediapipe/issues/1373
与这哥们报的错误差不多

这位大哥这样做的
在这里插入图片描述
当然你也可以在环境变量中添加:

export DISPLAY=:0	

launch.json 中这样添加
在这里插入图片描述

解决是解决了,但是给我整出来一个

Invalid MIT-MAGIC-COOKIE-1 Key(环境变量名字)

在这里插入图片描述
暂时不影响

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值