Ubuntu下OpenCV报错:QObject::moveToThread: Current thread (0x1b97af0) is not the object‘s thread 0&

Ubuntu下OpenCV报错:QObject::moveToThread: Current thread (0x1b97af0) is not the object‘s thread 0&,第1张

Ubuntu下OpenCV报错:QObject::moveToThread: Current thread (0x1b97af0) is not the object‘s thread 0&

文章目录
  • 项目场景:
  • 问题描述:
  • 原因分析:
  • 解决方案:


项目场景

之前的系统版本是 Python3.8 版本,在更新到 Python3.9 版本后,之前运行的好好的代码却运行不了了,下载好了相关的库后,仍出现相关报错。


问题描述

报错如下:

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

原因分析:

网上很多说是 OpenCV 版本太高,个人觉得是 pip 安装的 OpenCV 使用的插件与 Ubuntu Qt 平台兼容问题,由于 OpenCV 是用 pip 装的,所以换个方式安装。


解决方案:

打开终端,先卸载原来的 OpenCV:

pip uninstall opencv-python

使用如下命令重新安装 OpenCV:

sudo apt-get install libopencv-dev
sudo apt-get install python3-opencv

问题解决。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5679842.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存