I used this guide which installs OpenCV in a virtual environment, however I am getting the following error when I try to import the cv2 module:

$ source ~/.profile
$ workon cv
$ python
>>> import cv2
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
ImportError: No module named cv2

As far as I can see OpenCV is installed:

$ pkg-config --modversion opencv
$ 2.4.10

Installing openCV does not include the python bindings. You need to install these packages as well:

sudo apt-get install libopencv-dev python-opencv

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.