-2

File "c:\Users\csany\Documents\PYTHON_BEGINEERS\read.py", line 1, in import cv2 as cv File "C:\Users\csany\AppData\Local\Programs\Python\Python39\lib\site-packages\cv2_init_.py", line 5, in
from .cv2 import * ImportError: DLL load failed while importing cv2: The specified module could not be found.

Every time I try to run the code i get this error. I have installed OpenCV module through its source I have changed its path yet it still won't work in vs studio for python. Please help me out

H Sa
  • 128
  • 9

1 Answers1

0

You can download the latest OpenCV 3.2.0 for Python 3.6 on Windows 32-bit or 64-bit machine, look for file starts withopencv_python‑3.2.0‑cp36‑cp36m, from this unofficial site. Then type below command to install it:

  • pip install opencv_python‑3.2.0‑cp36‑cp36m‑win32.whl (32-bit version)
  • pip install opencv_python‑3.2.0‑cp36‑cp36m‑win_amd64.whl (64-bit version)

I think it would be easier.

Update on 2017-09-15:

OpenCV 3.3.0 wheel files are now available in the unofficial site and replaced OpenCV 3.2.0.

Update on 2018-02-15:

OpenCV 3.4.0 wheel files are now available in the unofficial site and replaced OpenCV 3.3.0.

Update on 2018-06-19:

OpenCV 3.4.1 wheel files are now available in the unofficial site with CPython 3.5/3.6/3.7 support, and replaced OpenCV 3.4.0.

Update on 2018-10-03:

OpenCV 3.4.3 wheel files are now available in the unofficial site with CPython 3.5/3.6/3.7 support, and replaced OpenCV 3.4.1.

Update on 2019-01-30:

OpenCV 4.0.1 wheel files are now available in the unofficial site with CPython 3.5/3.6/3.7 support.

Update on 2019-06-10:

OpenCV 3.4.6 and OpenCV 4.1.0 wheel files are now available in the unofficial site with CPython 3.5/3.6/3.7 support.

src : https://stackoverflow.com/a/43190144/13319197

H Sa
  • 128
  • 9
  • WARNING: Requirement 'opencv_python~4.4.0~cp36~cp36m~win_amd64.whl' looks like a filename, but the file does not exist ERROR: opencv_python~4.4.0~cp36~cp36m~win_amd64.whl is not a valid wheel filename. And that's what I get when I use the command prompt in windows. – SANYAM CHAURASIA Aug 15 '21 at 07:13
  • check the comment on answer. https://stackoverflow.com/a/43190144/13319197 – H Sa Aug 15 '21 at 08:32