Python3 cv2和matplotlib导入导致错误

2024-09-26 22:13:29 发布

您现在位置:Python中文网/ 问答频道 /正文

似乎当我尝试使用matplotlib和cv2时,我得到了一个奇怪的QT错误。我不知道是什么引起的,下面是它的样子:

QObject::moveToThread: Current thread (0x560dde045c50) is not the object's thread (0x560dde1a5030).
Cannot move to target thread (0x560dde045c50)

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/home/user/.local/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.

./ex1.sh: line 3: 43764 Aborted                 (core dumped) ./ex1/main.py

我不知道是什么导致了这种情况,但总是在我尝试调用plt.plot()时,这是我第一次在脚本中使用matplotlib


Tags: thetoapplicationmatplotlibnotpluginsqtcv2

热门问题