matplotlib | QObject::moveToThread:当前线程(0x831f000)不是对象的线程(0x95b40e0)。无法移动到目标线程 (0x831f000)

问题描述 投票:0回答:1

已有关于此错误的帖子,但未与使用

matplotlib
结合使用。

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

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/home/me/miniconda3/envs/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, minimal, minimalegl, offscreen, vnc, webgl.

Aborted (core dumped)
python-3.x qt matplotlib qobject xcb
1个回答
0
投票

在终端中设置环境变量

QT_PLUGIN_PATH
,可能会解决该错误:

export QT_PLUGIN_PATH=/home/me/miniconda3/envs/venv/lib/python3.9/site-packages/cv2/qt/plugins

如果没有,请安装依赖项:

sudo apt-get install libxcb1
pip install pyqt5
© www.soinside.com 2019 - 2024. All rights reserved.