QObject::moveToThread: Current thread (0x2550470) is not the object's thread (0x3fa6050).
Cannot move to target thread (0x2550470)
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/home/hs/dl/env/miniconda3/envs/pytorch-cp311-cu121/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, linuxfb, minimal, offscreen, vnc, webgl.
已中止 (核心已转储)
sudo apt install libxcb-* 无效
https://www.jb51.net/article/193024.htm 无效
opencv qt冲突 有效
pip install opencv-python-headless
将qt so路径加入环境变量
vim ~/.bashrc
尾部添加
export QT_QPA_PLATFORM_PLUGIN_PATH=/path/to/qt/plugins/platforms
更新
source ~/.bashrc
有so文件缺失 从gnu中copy
ldd xx.so | grep "not found"
排查缺失依赖,install
报错: GLIBCXX_3.4.30' not found
https://blog.csdn.net/pp2373886592/article/details/132392621
https://www.cnblogs.com/michaelcjl/p/18432886
找到gnu中符合GLIBCXX版本要求的文件,将conda下的文件与其建立软连接
cv2.show 报错
pip install opencv-contrib-python==4.10.0.84
版本同opencv
250114
每次开机都报错
- opencv-python降级 → 4.6.0.66
- 重装opencv-python-headless
- 成功