Home > other >  ImportError: DLL load failed while importing cv2
ImportError: DLL load failed while importing cv2

Time:10-21

When I install OpenCV, I get an error as shown below. What should I do?

ImportError: DLL load failed: The specified module could not be found.

Jupyter error

CodePudding user response:

Installing OpenCV

To install a package in Jupyter Notebook, you can use the magic %pip command.

%pip install opencv-python

If the above command doesn't work on IPython < 7.3, you can try this command instead.

!pip install --user opencv-python

Demonstration

Let's see it in action. First, you insert a new cell, type in either of the two commands above, and then execute the cell using the Ctrl Enter shortcut.

Installing OpenCV

You should now be able to import and use OpenCV without any errors.

Importing OpenCV

CodePudding user response:

This is usually a dependency issue. Just .pyd is not enough (all .DLLs are required). On Windows add entries to .dll into PATH environment variable (not enough for Python 3.8 with updated security policies)

  • Related