0

If I run the following I see that OpenCV is installed:

$ pkg-config --modversion opencv
$ 2.4.10

I have it installed in a virtual environment but when I try to import the cv2 module I get an error:

$ source ~/.profile
$ workon cv
$ python
>>> import cv2
<removed for brevity>
>>> ImportError: No module named cv2

Can anyone help?

2 Answers 2

2

The pkg-config --modversion opencv command only tells you your system has the development libraries and headers for OpenCV: the python bindings are in a separate package called python-opencv. You can install that from the Software Center, or from a terminal using

sudo apt-get install python-opencv
1

I also had this issue. Tried different things. But finally

conda install opencv

solved the issue for me.

1
  • +1 for likely relevant answer. Quick googling found this post on Stack Overflow. This method reportedly works in Ubuntu 14.04, but not with Python 3.4.
    – user37165
    Dec 6, 2015 at 19:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .