前言
用qtpy5和qtdesigner时,调用cv2和mmcv库的时候报错:
Got keys from plugin meta data ("xcb")
QFactoryLoader::QFactoryLoader() checking directory path "/root/anaconda3/envs/open-mmlab/bin/platforms" ...
loaded library "/root/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/cv2/qt/plugins/platforms/libqxcb.so"
QObject::moveToThread: Current thread (0x55b375f48ec0) is not the object's thread (0x55b3781aa460).
Cannot move to target thread (0x55b375f48ec0)
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/root/anaconda3/envs/open-mmlab/lib/python3.7/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.
一、解决方法
安装opencv-python-headless模块后,就解决了!!
pip install opencv-python-headless