简体   繁体   English

导入 CV2:DLL 加载失败:pip 安装成功时找不到指定的模块

[英]Import CV2: DLL load failed: The specified module could not be found while successful pip installation

I was working with Python 3.7 and OpenCV 4.2 in Pycharm IDE (Windows10).我在 Pycharm IDE (Windows10) 中使用 Python 3.7 和 OpenCV 4.2。 The system environment variables were changed by one of my co-workers by accident (we don't know what happened exactly).我的一位同事无意中更改了系统环境变量(我们不知道究竟发生了什么)。 Then I found that my code did not work with this error!:然后我发现我的代码没有出现这个错误!:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: DLL load failed: The specified module could not be found.

Then I used this command:然后我使用了这个命令:

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

All of them executed successfully, but when I write import cv2 the above error is appeared.所有这些都成功执行,但是当我编写import cv2出现上述错误。 By the way, the system knows command Python , it shows the right path to the python.exe .顺便说一句,系统知道命令Python ,它显示了python.exe的正确路径。 Moreover, commands like import numpy works correctly!此外,像import numpy这样的命令可以正常工作! How can I fix this problem?我该如何解决这个问题?

I found the answer!我找到了答案! There was an extra cv2.py file in site-packages/cv2 path.site-packages/cv2路径中有一个额外的cv2.py文件。 So, I removed it and the code worked所以,我删除了它并且代码有效

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 cv2 ImportError:DLL加载失败:找不到指定的模块 - cv2 ImportError: DLL load failed: The specified module could not be found 从.cv2导入* ImportError:DLL加载失败:找不到指定的模块 - from .cv2 import * ImportError: DLL load failed: The specified module could not be found ImportError: DLL 在导入 cv2 时加载失败:在 pycharm 中找不到指定的模块,python 3.9 - ImportError: DLL load failed while importing cv2: The specified module could not be found in pycharm with python 3.9 ImportError:DLL加载失败:找不到指定的模块。 在pycharm中导入cv2时 - ImportError: DLL load failed: The specified module could not be found. when importing cv2 in pycharm ImportError:DLL加载失败:找不到指定的模块。 CV2 - ImportError: DLL load failed: The specified module could not be found. cv2 导入错误:DLL 加载失败。 指定的模块无法找到 - Import Error: DLL load failed. The specified module could not be found Pyinstaller:导入错误:DLL 加载失败:找不到指定的模块 - Pyinstaller: Import Error: DLL load failed: The specified module could not be found 导入 pyrfc 时 DLL 加载失败:找不到指定的模块 - DLL load failed while importing pyrfc: The specified module could not be found DLL加载失败:导入scipy时找不到指定的模块 - DLL load failed: The specified module could not be found while importing scipy DLL加载失败:找不到指定的模块 - DLL load failed: The specified module could not be found
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM