Error: No module named cv2

NB : This answer is a short compilation of comments above. For more details, please refer to the comments below question.

Background : OP is using SPE Stani's python editor. OP has installed OpenCV /opt/ros/hydro/lib/python2.7/dist-packages which is not detected by the above mentioned editor. Adding this path to PYTHONPATH doesn't solve the issue.

Solution (any one of the below):

  1. Add this path to sys.path and put it in every file.

import sys sys.path.append('/opt/ros/hydro/lib/python2.7/dist-packages')

  1. Copy cv2.so file to any directory in the sys.path.

Tags:

Python

Opencv