Checking version of OpenCV (cv)

Venkat kamal picture Venkat kamal · Oct 19, 2017 · Viewed 38.1k times · Source

I was checking the version of OpenCV installed previously in a system. I tried to check using

from cv2 import __version__

Its gave me the following error

No module named cv2

When I tried import cv, it's not giving me error. Is there a way to know the version?

Answer

Giordano picture Giordano · Oct 19, 2017

Open a python interpreter (simply type python in your terminal).
Now, you should import cv2 and then check the special variable version.
Like this:

import cv2
cv2.__version__

For more details, check this link