import opencv vs import cv2
30,129
You should import cv2
. OpenCV releases two types of Python interfaces, cv
and cv2
. latest one is cv2
. This will give you an idea whether you have installed opencv
correctly.
Author by
stan25
Updated on July 09, 2022Comments
-
stan25 almost 2 years
I recently installed opencv-python-3.4.0.12 via pip install on Mac OS. When I run the Python interpreter,
import cv2
works fine whereasimport opencv
raises ModuleNotFoundError. However, when I run the Python3 Interpreter,import opencv
works fine whereasimport cv2
raises ModuleNotFoundError.What is the reason behind this difference and on a related note, should I use
import opencv
orimport cv2
? Doescv2
refer to OpenCV version 2?