报错AttributeError: module ‘cv2‘ has no attribute ‘ximgproc‘

报错AttributeError: module 'cv2' has no attribute 'ximgproc'

首先查看是否安装opencv-contrib-python

复制代码
pip list | grep opencv

显示

复制代码
opencv-contrib-python             4.4.0.46             
opencv-python                     4.8.1.78             
opencv-python-headless            4.7.0.72

说明本机上已经成功安装 opencv-contrib-python, opencv-python ,opencv-python-headless模块,但是为什么还会报错module 'cv2' has no attribute 'ximgproc'呢?

由于版本不一致的问题导致的。

将opencv-contrib-python升级为 opencv-python 一致的版本即可解决

复制代码
pip install opencv-contrib-python==4.8.1.78

解决后,再测试查看各模块版本为:

复制代码
pip list | grep opencv

显示

复制代码
opencv-contrib-python             4.8.1.78             
opencv-python                     4.8.1.78             
opencv-python-headless            4.7.0.72 
相关推荐
phantom_1113 天前
Cursor 分析 bug 记录
bug·cursor
Direction_Wind4 天前
Flinksql bug: Heartbeat of TaskManager with id container_XXX timed out.
大数据·flink·bug
AIBigModel7 天前
智能情趣设备、爆 bug:可被远程操控。。。
网络·安全·bug
Direction_Wind7 天前
flinksql bug: Received resultset tuples, but no field str
bug
远瞻。7 天前
【bug】diff-gaussian-rasterization Windows下编译 bug 解决
windows·bug
中草药z7 天前
【测试】Bug+设计测试用例
功能测试·测试工具·测试用例·bug·压力测试·测试
我又来搬代码了8 天前
【Android】【bug】Json解析错误Expected BEGIN_OBJECT but was STRING...
android·json·bug
葵野寺8 天前
【软件测试】BUG篇 — 详解
bug·测试
青青子衿越10 天前
微信小程序右上角分享页面找不到路径bug
微信小程序·小程序·bug
刘火锅11 天前
Bug 记录:SecureRandom.getInstanceStrong()导致验证码获取阻塞
spring boot·spring·spring cloud·bug