Linux_QObject::moveToThread: Current thread is not the object‘s thread

执行.py文件报错:

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

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/usr/local/lib/python3.8/dist-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.

------------------------------------------------------------------------------------------------

解决方法:

pip3 uninstall opencv-python
pip3 install opencv-contrib-python
sudo apt-get install python3-opencv

是跟AttributeError: module ‘cv2‘ has no attribute这个报错一块解决的,这个问题应该是contrib那句解决的...吧

你可能感兴趣的:(Linux,linux,opencv,python,pyqt5)