I'm trying to install OpenCV 2.4.7 on Raspberry Pi (Model B, OS: Raspbian).

The guides I'm referring to are:
2. Raspberry Pi + OpenCV
3. ... Don't have enough rep to link them all.

The problem is that I can't install all the required packages in order to be able to install OpenCV since I get the error:E: Unable to locate package package_name.

Here the list of packages I can't install (output of raspbian terminal):

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libucil2
E: Unable to locate package libucil2-dev
E: Unable to locate package libpngwriter0-dev
E: Unable to locate package libpngwriter0c2
E: Unable to locate package libavcodec52
E: Unable to locate package libavformat52
E: Unable to locate package libswscale0

Can anybody help me to get throughout this?

Additional information:
I'm connecting to Raspberry Pi through SSH (using PUTTY on Windows 7).
Raspberry Pi is correctly connected to internet through ethernet (I tested the connection using the midori web browser on raspbian).
I've tried several solutions found on the net but none solved the problem.

1 Answer 1


OpenCV 2.4.* does not work on the Raspberry Pi. The latest stable version that works on the Raspberry Pi is OpenCV 2.3.1, which is what your second website links to. The reason for this is the lack of an official V4L driver.

The reason you can't find those packages is because they are out of date. Substitute libavcodec53 and libavformat53 for libavcodec52 and libavformat52 and it should work. Newer versions of libpngwriter0-dev and libpngwriter0c2 are not available, but does not seem to affect the build.

Other than that, following your second links tutorial (where you compile it yourself) worked just fine for me.

  • 1
    thank Yes I successfully installed OpenCV 2.3.1. I thought I could just do the same with 2.4.6. Anyway, thank you for your answer and clarifications! Commented Nov 24, 2013 at 22:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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