python-opencv报错:QObject::moveToThread: Current thread

报错:
QObject::moveToThread: Current thread (0x55ab2a343120) is not the object’s thread (0x55ab2a4f8820).
Cannot move to target thread (0x55ab2a343120)
尝试了一些方法:
卸载pyqt5
conda install pyqt 安装 无效

最终的解决方案:
降低opencv的版本,如果安装了 opencv-contrib 也要相应的降低版本

这里我一开始的opencv-python == 4.4.0.46

后来修改成 opencv-python==4.1.1.26 完美解决
相应代码

# 卸载
pip uninstall opencv-python
pip uninstall opencv-contrib-python

安装

pip install opencv-python==4.1.1.26
pip install opencv-contrib-python==4.1.1.26

有用请点赞,年轻人要讲武德!

你可能感兴趣的:(踩坑总结,算法,python,计算机视觉)