OpenCV with Python (cv or cv2)

Chris Angelico rosuav at gmail.com
Fri May 29 10:51:08 EDT 2015


On Sat, May 30, 2015 at 12:29 AM, Markos <markos at c2o.pro.br> wrote:
> the simplest way to install opencv in jessie is:
>
> apt-get install python-dev libopencv-opencv
>
> And from what I saw the opencv package available in the repository is 2.4.9
>
> https://packages.debian.org/jessie/python-opencv
>
> And from what I saw on the site:
>
> https://packages.debian.org/jessie/python3
> and
> https://packages.debian.org/jessie/python
>
> There are packages in the repository for python 3.4.2-2 and 2.7.9-1
>
> My doubt is which version of Python (3.4.2-2 or 2.7.9-1) is compatible with
> the opencv library 2.4.9 available in the repository?

Since it's managed by the Debian repo, you can simply look at its
dependencies. In this case, python-opencv is built for Python 2, not
Python 3, so it'll pull in Python 2.7.9-1. Unfortunately there isn't a
corresponding python3-opencv package, so I don't know how hard it
would be to install for Python 3.4.2; but personally, I'd just try
using pip to install it.

$ apt-cache show python-opencv
Version: 2.4.9.1+dfsg-1+b1
Depends: python (<< 2.8), python:any (>= 2.7.5-5~), python (>= 2.7~),
libc6 (>= 2.14), libgcc1 (>= 1:4.1.1), libopencv-calib3d2.4,
libopencv-contrib2.4, libopencv-core2.4, libopencv-features2d2.4,
libopencv-flann2.4, libopencv-highgui2.4, libopencv-imgproc2.4,
libopencv-legacy2.4, libopencv-ml2.4, libopencv-objdetect2.4,
libopencv-photo2.4, libopencv-video2.4, libpython2.7 (>= 2.7),
libstdc++6 (>= 4.1.1), python-numpy-abi9, python-numpy (>= 1:1.6.1)

If you simply "apt-get install python-opencv", it'll make sure you
have the right Python installed.

ChrisA



More information about the Python-list mailing list