首页 > 解决方案 > 如何消除错误:“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 文件,文件夹就在那里。

请提出一些成功导入它的方法。

标签: cv2opencv-python

解决方案


假设您确实需要 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.

依赖关系。

如果再次失败,请使用第二种解决方案。

如果可行,请在评论部分发帖并接受此作为解决方案,否则请告诉我。


推荐阅读