[英]cv2 ImportError: DLL load failed: The specified module could not be found
[英]Import CV2: DLL load failed: The specified module could not be found while successful pip installation
我在 Pycharm IDE (Windows10) 中使用 Python 3.7 和 OpenCV 4.2。 我的一位同事無意中更改了系統環境變量(我們不知道究竟發生了什么)。 然后我發現我的代碼沒有出現這個錯誤!:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: DLL load failed: The specified module could not be found.
然后我使用了這個命令:
pip uninstall opencv-python
pip uninstall opencv-contrib-python
pip install opencv-python
所有這些都成功執行,但是當我編寫import cv2
出現上述錯誤。 順便說一句,系統知道命令Python
,它顯示了python.exe
的正確路徑。 此外,像import numpy
這樣的命令可以正常工作! 我該如何解決這個問題?
我找到了答案! 在site-packages/cv2
路徑中有一個額外的cv2.py
文件。 所以,我刪除了它並且代碼有效
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.