Python - pyqt xcb plugin with thread error

Viewed 1884

I am using Ubuntu, when I run my program from pyqt, I got this error,

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

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

Aborted (core dumped)

pip3 list|grep Qt for this command, I got

PyQt5                        5.15.5              
PyQt5-Qt5                    5.15.2              
PyQt5-sip                    12.9.0              
QtPy                         1.11.1   

I tried many solutions from uninstalling opencv-python and installig opencv-headless, export DISPLAY=:1.0 etc

But nothing worked, what should we do to solve this issue,

thanks

2 Answers

I had exactly the same problem when I deleted the qt folder the error was solved

in this path delete qt folder

/lib/python3.8/site-packages/cv2/qt/
Related