jaseg / python-mpv

Python interface to the awesome mpv media player
https://git.jaseg.de/python-mpv.git
Other
554 stars 69 forks source link

Error: libmpv.so.1: undefined symbol: mpv_render_context_create #116

Closed soleyj closed 4 years ago

soleyj commented 4 years ago

I have install:

And when I tried the example below:

import mpv player = mpv.MPV(ytdl=True) player.play('https://youtu.be/DOmdB7D-pUU') player.wait_for_playback()

I got the next error:

File "1.py", line 1, in <module> import mpv File "/home/linaro/.local/lib/python3.5/site-packages/mpv.py", line 563, in <module> _handle_func('mpv_render_context_create', [MpvRenderCtxHandle, MpvHandle, POINTER(MpvRenderParam)], c_int, ec_errcheck, ctx=None) File "/home/linaro/.local/lib/python3.5/site-packages/mpv.py", line 474, in _handle_func func = getattr(backend, name) File "/usr/lib/python3.5/ctypes/__init__.py", line 360, in __getattr__ func = self.__getitem__(name) File "/usr/lib/python3.5/ctypes/__init__.py", line 365, in __getitem__ func = self._FuncPtr((name_or_ordinal, self)) AttributeError: /usr/lib/arm-linux-gnueabihf/libmpv.so.1: undefined symbol: mpv_render_context_create

dfaker commented 4 years ago

Looks like mpv_render_context_create is a new relatively new addition to python-mpv most likely you have an older version of libmvp, can you specify the version of libmvp you're using?

soleyj commented 4 years ago

I have installed libmpv using apt install libmpv-dev And the version is 0.27.2

jaseg commented 4 years ago

libmpv 0.27.2 is from early 2018 and that is the cause of your error. To fix this, either use a similarly old release of python-mpv or update your libmpv. If your distro does not provide an up-to-date libmpv version downgrading python-mpv will be your only viable option. You can find a list of releases in the "releases" tab of this repository. From what it looks like v0.3.9, v0.3.10 or v0.4.0 have a good chance of working with libmpv 0.27.2. You can install these old versions from source by running "python3 setup.py install" in a checkout.

jaseg commented 4 years ago

I'm closing this issue now but I'll re-open it if the resolution did not work or you have further questions/comments :)