qt.qpa.plugin: Arch Linux で Qt プラットフォームプラグイン 'xcb' をロードできません。

qt.qpa.plugin: Arch Linux で Qt プラットフォームプラグイン 'xcb' をロードできません。

私は現在このコードを実行した後にいくつかの画像を出力しようとしています。

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"をインストールしたかったのですが、アーチリポジトリにそのようなパッケージがありませんでした(ただし、 "libxcb"があってインストールしましたが、まだこのエラーが発生しました)。

ベストアンサー1

おすすめ記事