Python 使用cv2模块 进入视觉识别的报错,报错信息为AttributeError: module ‘cv2.cv2’ has no attribute 'bgsegm

问题描述——cv2模块 进入视觉识别的报错,报错信息为AttributeError: module ‘cv2.cv2’ has no attribute 'bgsegm

问题原因

网上看了不少文章发现是少了这个模块导致的

后面使用命令安装模块就可以解决,

pip install opencv-contrib-python

但是我这边早就安装了这个模块,还是报错

后面发现opencv安装顺序可以不对,导致识别不到这个模块

解决方法

使用下面命令重新安装

pip uninstall opencv-python
pip uninstall opencv-contrib-python
pip install opencv-contrib-python

测试代码如图

问题解决,

Python 使用cv2模块 进入视觉识别的报错,报错信息为AttributeError: module ‘cv2.cv2‘ has no attribute ‘bgsegm相关推荐

  1. python报错AttributeError module ‘scipy.misc‘ has no attribute ‘imresize‘和 ‘imread‘

    python报错AttributeError: module 'scipy.misc' has no attribute 'imresize'和 'imread' 报错原因:scipy版本过高 解决方 ...

  2. 解决AttributeError: module ‘scipy.misc‘ has no attribute ‘imread‘报错问题

    运行python程序报错:AttributeError: module 'scipy.misc' has no attribute 'imread' 报错原因1:scipy版本过高 解决方案:降低sc ...

  3. mxnet报错解决:AttributeError: module 'mxnet.context' has no attribute 'num_gpus'

    早上在跑mxnet的mnist的示例代码时报错了,代码如下: import mxnet as mx ctx = mx.gpu(0) if mx.context.num_gpus() > 0 el ...

  4. 【Flask】flask-bootstrap报错AttributeError: module ‘dominate.tags‘ has no attribute ‘input‘解决方法

    问题 在使用flask-bootstrap渲染表单时,报错AttributeError: module 'dominate.tags' has no attribute 'input'. 解决方法 修 ...

  5. PythonPyQt5报错:AttributeError: module 'PyQt5.QtGui' has no attribute 'QMainWindow'

    在学习Python的PyQt5时,遇到了第一个问题:AttributeError: module 'PyQt5.QtGui' has no attribute 'QMainWindow' 代码如下 运 ...

  6. 报错与解决 | AttributeError: module ‘librosa.feature‘ has no attribute ‘rmse‘

    rmse → rms 代码:rmse = librosa.feature.rmse(y=y) 报错:AttributeError: module 'librosa.feature' has no at ...

  7. 【Python】Paramiko模块在Windows10中import ssl报错的处理方法

    上一篇文章[Python]Paramiko模块实现Linux服务器远程文件操作 介绍了如何通过Paramiko进行 sftp的操作,但最近遇到一个问题,换上家里的windows10电脑后,执行脚本时发 ...

  8. 给python安装tkinter模块(及各种问题的解决:如 ModuleNotFoundError: No module named ‘_tkinter’)

    文章目录 前言 1. 环境 2. 问题描述 3. 给Python2.7安装tkinter 4. 给python3.6.3安装tkinter(注意:这里失败了,但是过程值得记录一下) 5. [可行方案] ...

  9. python用cmd运行失败_解决python在cmd运行时导入包失败,出现错误信息 ModuleNotFoundError: No module named ***...

    1.下图为我的自动化测试工程结构图 我通过运行run.bat批处理文件,调用cmd控制台运行start_run.py来开始我的自动化测试,但是出现如下错误: 大家可能知道我们的工程在IDE(Pycha ...

最新文章

  1. JAVA 多线程实现包子铺(买包子,吃包子)
  2. C语言中 #pragma pack()
  3. 用init-connect+binlog实现用户操作追踪【转】
  4. 装了java_下载安装Java
  5. ALV 层级分组显示报表
  6. 路由有类查找和无类查找方式
  7. 编译运行linux0.12,linux0.12 编译过程
  8. Leetcode-1154 Ordinal Number Of Date(一年中的第几天)
  9. Docker简介和安装
  10. [bzoj 3110][zjoi 2013]K大数查询
  11. 一些实用但不为人知的Unix命令
  12. Excel技巧—超实用的字符串拆分小技巧
  13. 数据分析案例--淘宝用户行为分析
  14. 八爪鱼采集ajax表格,设置八爪鱼采集器ajax延时采集分页列表的方法
  15. Drug Target Review | 人工智能(AI)在基因组学中的作用
  16. oracle教程课件,Oracle入门教程(PPT课件)
  17. 新单词 part 13
  18. 工作流模式的学习与总结
  19. 均值滤波,中值滤波,最大最小值滤波
  20. MATLABR2016a安装与激活教程

热门文章

  1. 金蝶k3界面,菜单栏只显示了按钮图标没显示出对应的文字
  2. java jquery 文件下载_jQuery教程分享通过ajax下载文件
  3. 达内软件测试怎么样?一张图告诉你答案
  4. 上海迪士尼游记攻略(懒人佛系版,但丝毫不耽误快乐呀~)
  5. Rsync+inotify 实时同步
  6. Arduino fatal error: wiring.h: No such file or directory #include wiring.h
  7. POJ 3113 Manhattan Wiring(插头DP)
  8. 运行universe出现问题——glfw GLX initiation_未解决
  9. 阿里云计算巢加速企业软件云化,助力企业业务创新
  10. base operand of '-' has non-pointer type 'const Comple