I am running a PySide2 (Qt5) application on a Raspberry Pi 5 with Raspberry Pi OS Lite (64-bit, November 2024 release). When I try to run my script (python main.py), I get the following error:
What I Have Tried
1. Forcing the correct Qt path:2. Running without OpenCV's path:3.Reinstalling OpenCV without Qt support:System Information
Code:
Got keys from plugin meta data ("xcb")QFactoryLoader::QFactoryLoader() checking directory path "/usr/bin/platforms" ...loaded library "/home/mindrontm/.local/lib/python3.11/site-packages/cv2/qt/plugins/platforms/libqxcb.so"QObject::moveToThread: Current thread (0x2e862dc0) is not the object's thread (0x2e867840).Cannot move to target thread (0x2e862dc0)qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/home/mindrontm/.local/lib/python3.11/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.Aborted
What I Have Tried
1. Forcing the correct Qt path:
Code:
export QT_QPA_PLATFORM_PLUGIN_PATH=/usr/lib/aarch64-linux-gnu/qt5/plugins/platformsexport QT_PLUGIN_PATH=/usr/lib/aarch64-linux-gnu/qt5/pluginsexport QT_QPA_PLATFORM=xcbpython main.py
Code:
PYTHONPATH="" python main.py
Code:
pip uninstall opencv-pythonpip install opencv-python-headless
- Device: Raspberry Pi 5
- OS: Raspberry Pi OS Lite (64-bit, November 2024)
- Python: 3.11
- Qt Version: 5 (installed via system packages)
- PySide2 Version: Latest from pip
Statistics: Posted by aksharkalathiya — Wed Mar 12, 2025 8:34 am — Replies 0 — Views 46