Issue
I installed OpenCV for python2 by running:
`sudo apt-get install python-opencv`
But on running
import cv2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named cv2
My friend did the same and it's working on his machine.
Solution
I myself had the same issue, I solved it by first installing pip using the following command
sudo apt-get install python-pip
Then i installed opencv by,
pip install opencv-python
Then i tried importing cv2 in python and it worked like a charm:
import cv2
NOTE: Import must be done inside the python shell
Answered By - iniyavan Answer Checked By - David Marino (WPSolving Volunteer)