qt.qpa.plugin: Could not load the Qt platform plugin “xcb“ in “/home/w/anaconda3/lib/python3.9/site-

0. 前言

错误记录

报错如下:

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/home/w/anaconda3/lib/python3.9/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的版本

从 4.5 下降为 4.3.0.36

还有就是安装

sudo apt install –reinstall libxcb-xinerama0

需要在.bashrc添加两条语句,然后运行你程序的时候,就会输出更加详细的错误。具体不展开了,因为本文试了没用,不适合笔者问题。

主要问题还是opencv的问题,可以通过卸载重装即可,如下:

pip uninstall opencv-python
pip install opencv-python-headless

Original: https://blog.csdn.net/weixin_39190382/article/details/126518682
Author: 胡侃有料
Title: qt.qpa.plugin: Could not load the Qt platform plugin “xcb“ in “/home/w/anaconda3/lib/python3.9/site-

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/703176/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球