![qt.qpa.plugin:无法在 arch linux 上加载 Qt 平台插件“xcb”](https://linux22.com/image/196866/qt.qpa.plugin%EF%BC%9A%E6%97%A0%E6%B3%95%E5%9C%A8%20arch%20linux%20%E4%B8%8A%E5%8A%A0%E8%BD%BD%20Qt%20%E5%B9%B3%E5%8F%B0%E6%8F%92%E4%BB%B6%E2%80%9Cxcb%E2%80%9D.png)
我目前正在尝试在运行此代码后输出一些图像:
import cv2 as cv
import matplotlib.pyplot as plt
img = cv.imread('Photos/cat.jpg')
cv.imshow('cat', img)
plt.imshow(img)
plt.show()
但相反,我在 Pycharm 中收到以下错误消息:
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/home/Joel/PycharmProjects/opencv_project/venv/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.
我想安装“xcb”,但在 arch 存储库中没有这样的包(尽管有“libxcb”,所以我安装了它,但仍然收到此错误)。