cv2.imshow-qt

文章讲述了在MacOS13.5.1环境下,使用Python3.7.1和cv24.2.0时遇到警告并报错的问题,主要介绍了如何解决cv2.imshow的警告,以及推荐安装opencv-python-headless4.2.0.34版本来避免AttributeError。

项目场景:图像处理-python代码报错

cv2.imshow: 报Warning You might be loading two sets of Qt binaries into the same process

系统环境:
MAC M2芯片 MACOS 13.5.1
Python 3.7.1
Python库
cv2 4.2.0
opencv-python 4.4.0.44


问题描述

  1. cv2.imshow:
报Warning You might be loading two sets of Qt binaries into the same process
  1. 安装后报警Error:
import cv2
AttributeError: module 'cv2' has no attribute '_registerMatType'


原因分析:

参考:

  1. https://blog.51cto.com/doubleZ/5986533
  2. https://developer.aliyun.com/article/1124246

解决方案:

1 安装opencv-python-headless

2 安装低版本 opencv-python-headless<4.3

pip3 install opencv-python-headless==4.2.0.34
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值