ros-melodic-cv-bridge is depending on libavcodec.so.56
I installed ros-melodic-cv-bridge
apt-get install ros-melodic-cv-bridge
But when I run python
from cv_bridge import CvBridge
CvBridge()
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.7/dist-packages/cv2/__init__.py", line 89, in <module>
bootstrap() File "/usr/local/lib/python2.7/dist-packages/cv2/__init__.py", line 79, in bootstrap
import cv2
ImportError: libavcodec-ffmpeg.so.56: cannot open shared object file: No such file or directory
I don't have libavcodec-ffmpeg.so.56. And when I search for libavcodec and ffmpeg packages all I see for Ubuntu 18.04 (which is what melodic runs on) is version 57.
Where does this library come from?
I know melodic changed such that it now uses the host install of opencv - is that my problem? I'm on OpenCv 3.4.5.
Do you have a Python 2.7 installed from source on your machine?
I would expect system-provided (and managed) Python installs on Ubuntu to be located in
/usr/lib
,/usr/bin
, etc.Does anyone have an answer to this? I've spent days on it with no success.
Is this right? Melodic runs on 18.04, which deletes/overwrites libavcodec-ffmpeg.so.56 and replaces it with libavcodec-ffmpeg.so.57 , thereby ensuring opencv won't import (at least in Python).
To fix this do you:
1) as above, is dodgy if you use an older repository
2) I can't find out anywhere what versions don't depend on 56. Also, there seems a difference whether are using python2 or python3.
One thing I would not recommend unless you want to qo quite mad, is try to setup melodic with python3 support.