cv2 - 如何消除错误:“ImportError:DLL 加载失败:找不到指定的模块。” 在 jupyter notebook 中导入 cv2 时
问题描述
我已经安装了opencv-python
pip install opencv-contrib-python
我的设备上也安装了 python 3.7.2(Windows 10)
在导入 cv2 时,会显示:
ImportError: DLL load failed: The specified module could not be found.
我什至检查了 anaconda3 中的 python3.dll 文件,文件夹就在那里。
请提出一些成功导入它的方法。
解决方案
假设您确实需要 contrib 模块,对于您指定的错误,
尝试这个:
1. make sure you have Visual C++ redistributable 2015 installed. If you are using older Windows version than Windows 10 and latest system updates are not installed, Universal C Runtime might be also required.
pip 上的 Contrib 文档清楚地提到这是作为先决条件安装的。
2. If you still encounter the error after you have checked all the previous solutions, download Dependencies and open the cv2.pyd (located usually at C:\Users\username\AppData\Local\Programs\Python\PythonXX\Lib\site-packages\cv2) file with it to debug missing DLL issues.
如果再次失败,请使用第二种解决方案。
如果可行,请在评论部分发帖并接受此作为解决方案,否则请告诉我。
推荐阅读
- optimization - Pytorch 中的 .optimizer 包是什么?
- c# - 如何根据另一个页面隐藏页面中的元素
- c# - 如何在我自己的代码中使用这个 Crc32 类
- javascript - 如何控制为不同dom元素绑定的jquery keydown事件执行?
- javascript - 如何使用上下文 api 将数据从一个组件传递到另一个组件
- python - VS Code Python 调试器 - 返回期间的参数值
- forms - 如何分别切换文本字段上的后缀图标
- javascript - JavaScript 函数的返回值
- node.js - NodeJS 多个异步请求
- python - 在 Robot 框架中解析 JSON 输出 [在论坛中尝试了大多数选项]