Skip to content

solved: Could not load the Qt platform plugin "xcb"  #299

@ljubomirb

Description

@ljubomirb

I will leave here solution for a problem that I could not fix for days, hope it would help someone:
So, the error was:

QObject::moveToThread: Current thread (...) is not the object's thread (...).
Cannot move to target thread (...)
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/(...)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.

I was trying hard, but could not fix it. I was downloading literally hundreds of different packages, over and over again, trying all sorts of "hacks" found online, eventually trying anaconda, a massive download...
In the end, I don't know if that was the fix, because my system is about to be reinstalled after all of my "trying", BUT, after I wrote this in console:
export QT_QPA_PLATFORM=offscreen
everything worked.
Again, don't know if this was solution OR any of hundreds of packages installed, but try this first. If it works, maybe add this to Q&A .
Good luck!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions