Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qt.qpa.plugin: Could not load QT platform 'xcb' in .... even though it was found Error #24

Open
gabriel-ing opened this issue Sep 6, 2023 · 0 comments

Comments

@gabriel-ing
Copy link
Owner

This is an error which has cropped up a few times on various Linux set-ups, I believed I had fixed this as of version 1.0.6 but a user has recently reported it to me. I believe it comes from a conflict between openCV and pyQT6, and I fixed it on my machine by changing from pyQT5 to pyQT6, but the issue remains.

I have found a fix for the issue:

Firstly, type into the command-line:

QT_DEBUG_PLUGIN=1

This gives debugging information.

The error then changes to:

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

A fix I have found elsewhere online is running:

export QT_QPA_PLATFORM=offscreen

However if trying to use the GUI, it will no longer appear.

Instead, this issue seems to be related to the file libqxcb.so which is found in the path detailed in the above error. Strangely, removing this file has been found to fix this error. Simply try:

rm /home/anaconda3/envs/SimpliPyTEM/lib/python3.8/site-packages/cv2/qt/plugins/libqxcb.so

Note that this path may change slightly depending on your install.

This fix has worked for me. If you find this error and are struggling, have a go, if it does not work please report it here and we can try another fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant