'Why python can't find libavcodec.so.54 after Ubuntu update from 14.10 to 16.04?

I've update from Ubuntu 14.10 to 16.04 yesterday and right now I've tried to run my old python + opencv files but every file with opencv gives the same error:

python blendImages.py 
Traceback (most recent call last):
  File "blendImages.py", line 2, in <module>
    import cv2
ImportError: libavcodec.so.54: cannot open shared object file: No such file or directory

you know some workaround this?



Solution 1:[1]

I think it may help if you install these packages.

sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
sudo apt-get install libxvidcore-dev libx264-dev

and FFmpeg as well.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 jprofitt