OpenCV 2.1 was first installed when I had the original python 2.6 and this works fine. However after getting the Python 3.1, it has no module called 'cv' after trying to import OpenCV. How to add these modules?
3 Answers
According to this answer on StackOverflow, OpenCV doesn't support Python 3 and no one is working on Python 3 support either.
1As of April 2019, you can install opencv for Python 2.7 and 3.4-3.7. It can be installed via pip for PythonV2 and pip3 for PythonV3:
pip3 install opencv-python- In case of installation problems you may need to upgrade your
pipversion (pip install --upgrade pip) Despite the package name the module is still imported in Python using:
import cv2
See for details.
Simply use import statement. First go to
$ cd /usr/local/lib/python2.6/site-packages/opencvThen start python:
$ python
>>> import cv.pyFor any other help, refer and .
2