Ask Your Question

Revision history [back]

I have encountered the same problem:

>>> import cv2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: /usr/lib/x86_64-linux-gnu/libavcodec.so.57: symbol avpriv_slicethread_free version LIBAVUTIL_55 not defined in file libavutil.so.55 with link time reference

I use the command:locate

Lenovo:/usr/lib/x86_64-linux-gnu$ locate libavutil.so.55

/data/pyenvs/bob_py3/lib/libavutil.so.55
/data/pyenvs/bob_py3/lib/libavutil.so.55.78.100
/opt/kingsoft/wps-office/office6/libavutil.so.55
/opt/kingsoft/wps-office/office6/libavutil.so.55.17.103
/usr/lib/x86_64-linux-gnu/libavutil.so.55
/usr/lib/x86_64-linux-gnu/libavutil.so.55.58.100

and then I copy the file (/data/pyenvs/bob_py3/lib/libavutil.so.55.78.100) to the path (/usr/lib/x86_64-linux-gnu/libavutil.so.55.58.100). Relink the file.

Lenovo:/usr/lib/x86_64-linux-gnu$ sudo cp /data/pyenvs/bob_py3/lib/libavutil.so.55.78.100 .

Lenovo:/usr/lib/x86_64-linux-gnu$ sudo ln -s libavutil.so.55.78.100 libavutil.so.55

It work.

Python 3.5.5 |Anaconda, Inc.| (default, May 13 2018, 21:12:35) 
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> print(cv2.__version__)
3.2.0
>>>