Import Error: Python unable to detect OpenCV libraries for OpenCV local installation

asked 2017-03-28 02:36:29 -0500

missionary gravatar image

I have installed OpenCV locally in a directory named /home/zeus/Libraries/opencv-2.4.13/release/install. C++ programs are working fine as I have configured the shared libraries so that they are detected from the local install. However, on running import cv2 in the python shell is giving the following error -

ImportError: Traceback (most recent call last)
<ipython-input-1-5689afc08b90> in <module>()
----> 1 import cv2 as cv

ImportError: No module named cv2

Therefore, I need to give some path for python to detect the opencv library which is stored in /home/zeus/Libraries/opencv-2.4.13/release/install/lib/python2.7/dist-packages/ which is a local directory. How can I do that?

edit retag flag offensive close merge delete