【发布时间】:2021-05-02 11:16:00
【问题描述】:
我正在使用 WSL,当使用 OpenCV 运行一些需要打开不同窗口的 Python 代码时,它会引发错误。 这是代码:
import cv2 as cv
image = cv.imread("images/pic.jpg")
cv.imshow(0)
cv.waitKey(0)
这是我得到的错误
qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/home/user/.local/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.
Aborted (core dumped)
【问题讨论】:
标签: python linux opencv computer-vision windows-subsystem-for-linux