-1

I have installed python 3.11.5 on my windows machine and I have downloaded opencv using the command:

pip3 install opencv-python

I have followed this tutorial to copy the python 3.10 cv2 file of OpenCV (as there is no 3.11 python file) and opencv_world480.dll file in python 3.11.5 site-packages.

But when I try to import cv2 in python idle, it appears the following error:

Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    import cv2
ImportError: DLL load failed while importing cv2: %1 no es una aplicación Win32 válida.

I have read this post and I have tried using the "unofficial site" (pip install opencv_python-3.2.0‑cp36‑cp36m‑win_amd64.whl) but it still does not work.

I have also tried with: pip install opencv-contrib-python

But still having the same result.

I'm not sure if I am adding cv2 to python site-packages as it should be as I have in the end:

Python site packages

Markus
  • 5,976
  • 5
  • 6
  • 21
Mm M
  • 1
  • 1
  • You always need to include complete error messages, verbatim. – Dr. Snoopy Aug 29 '23 at 10:41
  • The complete error is: "Traceback (most recent call last): File "", line 1, in import cv2 ImportError: DLL load failed while importing cv2: %1 no es una aplicación Win32 válida" – Mm M Aug 29 '23 at 10:45
  • You can't use a binary module build for Python 3.10 with Python 3.11 -- the library links to a Python DLL of the particular version (that's why the distribution package has 6 different binaries for Pythons between 3.5 and 3.10). Switching to a 6.5 year old OpenCV 3.2.0, built for Python 3.6, is hardly going to make things better. – Dan Mašek Aug 29 '23 at 12:02

0 Answers0