报错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 
相关推荐
DarkAthena5 小时前
【ORACLE】记录一些ORACLE的merge into语句的BUG
数据库·oracle·bug
猫猫头有亿点炸6 小时前
大数据可能出现的bug之flume
大数据·bug·flume
PLUS_WAVE6 小时前
【CUDA 编译 bug】ld: cannot find -lcudart
服务器·c++·bug·环境·编译·cuda·ld
宁酱醇1 天前
各种各样的bug合集
开发语言·笔记·python·gitlab·bug
有什么东东1 天前
山东大学软件学院创新项目实训开发日志(20)之中医知识问答自动生成对话标题bug修改
java·vue·bug·springboot
软件技术NINI1 天前
详解BUG(又名:BUG的生命周期)
bug
兮动人1 天前
Idea使用github copilot登录bug+解决方案
github·bug·intellij-idea
Macle_Chen1 天前
ios开发中xxx.debug.dylib not found
ios·bug·debug.dylib
福大大架构师每日一题1 天前
docker v28.1.1 正式发布!修复关键Bug,网络与安全性再升级
网络·docker·bug
小徐Chao努力1 天前
【记录手贱bug日常】IDEA 配置vmoptions后打不开,重新安装,删注册表均无用
java·bug·intellij-idea