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.

Share:
30,129
stan25
Author by

stan25

Updated on July 09, 2022

Comments

  • stan25
    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 whereas import opencv raises ModuleNotFoundError. However, when I run the Python3 Interpreter, import opencv works fine whereas import cv2 raises ModuleNotFoundError.

    What is the reason behind this difference and on a related note, should I use import opencv or import cv2? Does cv2 refer to OpenCV version 2?