Loading...

How do I import cv2


I'm quite new to python and I'm currently working with opencv. After a few days working with cv2, the DLL load failed during import of cv2 error occurred. I read everything I could online, especially here, since there are similar questions, trying to solve the issue. In particuar I have already tried to :

  • paste the python3 DLL file in the Anaconda3 folder
  • downgrade python version
  • install/uninstall opencv via pip and conda
  • uninstall and install anaconda from the beginning

without succeeding. I am using ST3, and here's some info about Conda and Python versions:

      conda version : 4.6.3
conda-build version : 3.17.6
     python version : 3.7.1.final.0

Furthermore, when installed opencv-python via pip, a new error was displayed while importing cv2:

    from .cv2 import *
ImportError: numpy.core.multiarray failed to import

I tried to fix this issue (that appears to be related to numpy) as well, without succeeding.

Any suggestion is greatly appreciated!

- - Source

Answers

answered 1 week ago LC- #1

I fixed the issue by adding Library\bin to PATH environment variables: bin folder contains the needed DLL files!

comments powered by Disqus