bug -- Pyqt5+openCV报错(QObject::moveToThread:)

报错什么线程无法移动,妈个鸡狗屁不是

使用pyqt和opencv的做的GUI程序中出线的问题

就是opcv-python的版本对不上

系统 py版本(conda) 报错
Ubuntu21 3.9 Cannot move to target thread
QObject::moveToThread: Current thread (0x5560b72388b0) is not the object's thread (0x5560b74641b0).
Cannot move to target thread (0x5560b72388b0)


这个报错是上面的报错引起的
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/home/fly/anaconda3/envs/video/lib/python3.9/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.

解决方案:降版本,网上的都是说降opencv版本,这里推荐降python(血泪记忆)

opencv-python4.1.2.30
把上面的文件下载,本地安装即可(虚拟环境切换到相应的虚拟环境)

pip install opencv_python-4.1.2.30-cp38-cp38-manylinux1_x86_64.whl 

成功解决

bug -- Pyqt5+openCV报错(QObject::moveToThread:)_第1张图片

bug -- Pyqt5+openCV报错(QObject::moveToThread:)_第2张图片

你可能感兴趣的:(bug,opencv,qt,python)