兄弟们看看是不是这个错:
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(环境变量名字)
暂时不影响