open cv module cannot be imported
Question:
While importing OpenCV python by the code below
import cv2
I can’t import the module instead it gives me an error.
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import cv2
File "C:Users2684jAppDataLocalProgramsPythonPython39libsite-packagescv2__init__.py", line 5, in <module>
from .cv2 import *
ImportError: DLL load failed while importing cv2: The specified module could not be found.
Answers:
Try the following
pip install opencv-contrib-python
So I have tried many ways and I have found an exact problem
here below I have given the steps clearly to solve this problem
- first navigate to your python folder
- then navigate further to Libsite packagescv2..
- then create an folder name cv2 do not change the folder name create a folder with cv2 as its name
- leaving the
_init_.py
file copy all other files into the cv2 folder do not just copy just perform an cut copy paste action
this is the exact way to solve this problem
While importing OpenCV python by the code below
import cv2
I can’t import the module instead it gives me an error.
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import cv2
File "C:Users2684jAppDataLocalProgramsPythonPython39libsite-packagescv2__init__.py", line 5, in <module>
from .cv2 import *
ImportError: DLL load failed while importing cv2: The specified module could not be found.
Try the following
pip install opencv-contrib-python
So I have tried many ways and I have found an exact problem
here below I have given the steps clearly to solve this problem
- first navigate to your python folder
- then navigate further to Libsite packagescv2..
- then create an folder name cv2 do not change the folder name create a folder with cv2 as its name
- leaving the
_init_.py
file copy all other files into the cv2 folder do not just copy just perform an cut copy paste action
this is the exact way to solve this problem