/usr/lib/pyshared/python2.7/cv2.so depends on missing libavcodec52?

Bug #1161485 reported by Gerwin
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
opencv (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

After installing python-opencv in Ubuntu 12.04 LTS, the python statement "import cv2" results in an error:

ImportError: libavcodec.so.52: cannot open shared object file: No such file or directory

Which is correct since libavcodec.so.52 is not installed nor is it possible to install it from the regular respositories since itis be replaced by libavcodec.so.53. Checked with another system, which also runs 12.04, but a fresh install instead of an upgrade from 10.04 (some time ago) and to my astonishment, the same .deb package (downloaded straight from http://nl.archive.ubuntu.com/ubuntu/pool/universe/o/opencv/python-opencv_2.3.1-7_i386.deb and unpacked with dpkg -x) show different dependencies:

gerwin@PC1:/tmp/python-opencv/usr/lib/pyshared/python2.7$ ldd cv2.so | grep avcodec
  libavcodec.so.53 => /usr/lib/i386-linux-gnu/i686/cmov/libavcodec.so.53 (0xb51f7000)

vs.

gerwin@PC2:/tmp/python-opencv/usr/lib/pyshared/python2.7$ ldd cv2.so | grep avcodec
  libavcodec.so.52 => not found

Is there another part in the system that defines the dependencies other than the files themselves?

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in opencv (Ubuntu):
status: New → Confirmed
Revision history for this message
mythsmith (mythsmith) wrote :

This bug also affects Ubuntu 14.04.
python-opencv tries to import libavcodec.so.53, which is not installable and is not listed in python-opencv dependencies.

  File "/usr/lib/python2.7/dist-packages/cv.py", line 1, in <module>
    from cv2.cv import *
ImportError: libavcodec.so.53: cannot open shared object file: No such file or directory

The repositories only list 52 and 54. I tried symlinking the missing dependencies to newer version, but it does not

ln -s /usr/lib/x86_64-linux-gnu/libavcodec.so.54 /usr/lib/x86_64-linux-gnu/libavcodec.so.53
ln -s /usr/lib/x86_64-linux-gnu/libavformat.so.54 /usr/lib/x86_64-linux-gnu/libavformat.so.53
ln -s /usr/lib/x86_64-linux-gnu/libavutil.so.52 /usr/lib/x86_64-linux-gnu/libavutil.so.51

But then it will fail with:
  File "/usr/lib/python2.7/dist-packages/cv.py", line 1, in <module>
    from cv2.cv import *
ImportError: /usr/lib/x86_64-linux-gnu/libavutil.so.51: version `LIBAVUTIL_51' not found (required by /usr/lib/libopencv_highgui.so.2.4)

Output of ldd /usr/lib/python2.7/dist-packages/cv2.so | grep "not found":
 libavcodec.so.53 => not found
 libavformat.so.53 => not found
 libavutil.so.51 => not found

This affects 64bit systems, BUT NOT 32bit systems.

So, it seems that:
1. The 64bit python-opencv package is compiled against libraries which does not exist in 14.04 (but 32bit is OK).
2. libavcodec, libavformat, libavutil and maybe other libraries are not listed as dependencies (in both arch).

Revision history for this message
Mattia Rizzolo (mapreri) wrote :

I confirm this happens in trusty amd64, but it's fixed in xenial and later, so I'm marking it as such.

Changed in opencv (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.