ubuntu系统运行qt出现报错:qt.qpa.plugin: Could not load the Qt platform plugin “xcb“ in “/home/anaconda3/
pip install opencv-python-headless# 无Qt依赖的版本。卸载重新安装无qt以来版本的opencv库后,qt界面可以正常运行,无报错显示。如果程序使用了OpenCV(如Python的。# 重新安装OpenCV(避免携带Qt插件)),其内置的Qt可能与系统Qt版本冲突。
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/home/anaconda3/envs/yolov5/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.
Available platform plugins are: xcb, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl.
报错原因:OpenCV与Qt的兼容性问题,如果程序使用了OpenCV(如Python的cv2),其内置的Qt可能与系统Qt版本冲突。
解决方法:
# 重新安装OpenCV(避免携带Qt插件) pip uninstall opencv-python opencv-python-headless pip install opencv-python-headless # 无Qt依赖的版本
卸载重新安装无qt以来版本的opencv库后,qt界面可以正常运行,无报错显示。
火山引擎开发者社区是火山引擎打造的AI技术生态平台,聚焦Agent与大模型开发,提供豆包系列模型(图像/视频/视觉)、智能分析与会话工具,并配套评测集、动手实验室及行业案例库。社区通过技术沙龙、挑战赛等活动促进开发者成长,新用户可领50万Tokens权益,助力构建智能应用。
更多推荐

所有评论(0)