我目前正在尝试在运行此代码后输出一些图像:
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”,所以我安装了它,但仍然收到此错误)。