我安裝的OpenCV的python 3.6.0 使用命令爲什麼在Python 3.6.0進口CV2顯示錯誤的Anaconda3
pip install OpenCV-python
但顯示錯誤,當我在代碼
代碼
import cv2
def vidPlay():
cap = cv2.VideoCapture(0)
ret, inputImage = cap.read()
if ret==True:
return inputImage
cap.release()
a = vidPlay()
print(a)
print("done ")
cv2.imshow(a)
錯誤
File "<stdin>", line 1, in <module>
File "C:\Users\yyy\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 866, in runfile
execfile(filename, namespace)
File "C:\Users\yyy\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "C:/Users/yyy/Desktop/cameraPlay.py", line 1, in <module>
import cv2
File "C:\Users\yyy\Anaconda3\lib\site-packages\cv2\__init__.py", line 7, in <module>
from . import cv2
ImportError: DLL load failed: The specified module could not be found.
我在問題上嘗試過不同的解決方案,但沒有解決我的問題。
請出示你的代碼,當我運行的代碼引發錯誤 –
@MuhammadAsif行這顯示出[進口CV2當DLL加載失敗錯誤] –
可能的複製(https://stackoverflow.com/questions/43184887/dll-load-failed-error-when-importing-cv2) –