QObject::moveToThread: Current thread(...) is not the object`s thread. Cannot move to target thread(

这篇具有很好参考价值的文章主要介绍了QObject::moveToThread: Current thread(...) is not the object`s thread. Cannot move to target thread(。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

最近在使用 conda 环境踩了个坑,运行 opencv 项目时弹出满屏的 Qthread 报错。

网上的解决方法大多是把 opencv-python 降级,或者 sudo 用包管理器安装到系统,但是都没有很彻底或者说优雅地解决问题。

问题描述

python 3.8 (conda) 环境下,运行 opencv 项目出现报错:QObject::moveToThread: Current thread(…) is not the object`s thread. Cannot move to target thread(…)。

问题溯源

以上报错是由于使用 conda 安装 pyqt ,用 pip 安装 opencv ,由版本冲突导致的:

如果您使用 Anaconda 虚拟环境并同时执行 conda install pyqtpip install opencv-python。 opencv-python 会在两个 PyQt 版本之间产生冲突并导致错误。

解决方案

卸载当前用 conda 装的 PyQt:

conda uninstall pyqt

通过 pip 安装 PyQt :

pip install PyQt5
pip install opencv-python

参考

解决方案参考 stackoverflow 答主 a_guest :原帖地址文章来源地址https://www.toymoban.com/news/detail-501972.html

到了这里,关于QObject::moveToThread: Current thread(...) is not the object`s thread. Cannot move to target thread(的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • WASubContext.js?t=wechat&srouteDone with a webviewId 26 that is not the current

    使用HBuilderx开发uniapp项目,运行成功打开微信开发者工具时,会有一个报错,看着很烦 只需要在我们的pages.json中配置 \\\"lazyCodeLoading\\\": \\\"requiredComponents \\\",这条语句就OK了, 再重新打开微信开发这工具就没有了,如果还有可以重新运行项目,目前我的是这样解决的. ok!

    2024年02月10日
    浏览(29)
  • 【避坑】paddlepaddle-gpu安装报错:The GPU architecture in your current machine is Pascal, which is not

    完整的系统、显卡等环境如下: 系统:win10 显卡:GeForce GTX 1060 6GB python 3.7.16 cuda:cuda 11.2.0 cudnn:cudnn 8.2.1 paddlepaddle:pip安装 版本:gpu==2.5.1.post112 安装指令为: 安装成功后,测试结果如下: 注意这个警告信息: The GPU architecture in your current machine is Pascal, which is not compatible

    2024年02月08日
    浏览(36)
  • 微信小程序出现routeDone with a webviewld 42 that is not the current page这个bug解决

    微信开发者工具基础库版本过高,可能会出现如下官方Bug routeDone with a webviewld 42 that is not the current page是因为微信开发者工具基础库版本用了最新的2.30.3但官方一直未解决这个问题,只有使用2.25.4的基础库才能使用。 为便于开发者解决低版本基础库无法兼容小程序的新功能的

    2024年02月11日
    浏览(53)
  • Cannot invoke “Object.toString()“ because the return value of “java.util.Map.get(Object)“ is null

    在写瑞吉外卖的时候遇到 Object.toString()为空的问题,最后发现是 前端没有往后端传递数据,第一个图片是只传的phone最后改为from第二个是没有写函数sendMsgApi,改正后,发现登录进去又回退到主页面,发现是因为在过滤器中要保存session,保存后才能发送,再次添加形参Http

    2024年02月02日
    浏览(46)
  • 【一步搞定】uniapp运行微信小程序时报错routeDone with a webviewId ** that is not the current page

    每次刷新还不同webviewId!! 每次刷新还不同webviewId!! 已试过其他帖子,设置pages.json的配置仍旧无效的,可以继续往下。 小程序基础库支持的问题。 基础库版本 版本 实测效果 3.0 无效 2.33.0 无效 2.32.3 无效 2.32.1 无效 2.30.4 无效 2.29.2 无效 2.28.1 无效 2.27.3 无效 2.26.2 有效 点

    2024年04月09日
    浏览(99)
  • uni-app运行微信小程序时报错routeDone with a webviewId 2 that is not the current page

     在开发微信小程序时使用HBuilderX uni-app开发运行项目的时候新手可能会出现 routeDone with a webviewId 1 that is not the current page 这个报错,有时是因为调试基础库处于灰度中所以会出现这个报错信息,想解决这个报错我们可以尝试降一下微信开发者工具的调试基础库,总共分为三步

    2024年02月11日
    浏览(39)
  • 【Qt】多线程QThread::run()与QObject::moveToThread()

    官方链接QThread Class | Qt Core 5.15.14 使用 QThread::run() 简单来说就是继承QThread类,并重写run()函数,这样run()函数中的代码就会运行在子线程中。 QThread对象管理着一个线程,并通过start函数启动这个线程,线程要执行的代码都在run()里面,run()函数的进入和返回,就相当于子线程的

    2024年02月08日
    浏览(33)
  • IDEA运行报错:Cannot start compilation: the output path is not specified.

    报错信息: “Cannot start compilation: the output path is not specified for module \\\"TestJar\\\". Specify the output path in the Project Structure dialog.” 原因分析: Output directory is not specified 报错的意思是没有指定输出路径。idea需要在项目下生成一个out输出文件目录,该目录下会存放java文件运行后的字节

    2024年02月12日
    浏览(41)
  • 解决IDEA运行时报错Cannot start compilation: the output path is not specified for module “xxxxx“.

    友情提醒: 先看文章目录,大致了解文章知识点结构,点击文章目录可直接跳转到文章指定位置。 报错如下:Cannot start compilation: the output path is not specified for module \\\"xxxxx\\\". Specify the output path in the Project Structure dialog. 翻译成中文: 无法启动编译:未为模块\\\"xxxx\\\"指定输出路径,在

    2024年02月05日
    浏览(40)
  • 解决问题 Could not obtain transaction-synchronized Session for current thread

    一、问题现象 在使用Hibernate的项目中,在一个定时任务中,执行某段代码,满足条件后,更新表数据。 程序在执行到更新表数据的时候,报错如下: 二、解决方案 在 spring-config.xml 配置事务 切入点 和 切入方法 [说明] 1、tx:method name=“dispose*” propagation=“REQUIRED” / 表示对

    2024年02月08日
    浏览(48)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包