jaseg / python-mpv

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

Symbol not found error when using older libmpv #212

Closed musicfunfan closed 2 years ago

musicfunfan commented 2 years ago

Hello again. I try to use mpv.py on LInux Mint 20.3. And i get this error.

  File "test2.py", line 1, in <module>
    import mpv
  File "/home/msuicfun/Giorgos/ergasia_hmu/cli/mpv.py", line 579, in <module>
    _handle_func('mpv_event_to_node',           [POINTER(MpvNode), POINTER(MpvEvent)],      c_int, ec_errcheck, ctx=None)
  File "/home/msuicfun/Giorgos/ergasia_hmu/cli/mpv.py", line 502, in _handle_func
    func = getattr(backend, name)
  File "/usr/lib/python3.8/ctypes/__init__.py", line 386, in __getattr__
    func = self.__getitem__(name)
  File "/usr/lib/python3.8/ctypes/__init__.py", line 391, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /lib/x86_64-linux-gnu/libmpv.so.1: undefined symbol: mpv_event_to_node

I think this is happening because i have an old libmpv. If this is the case how can i build a recent libmpv fot linux to use with python-mpv ?

The libmpv on Linux Mint is in version 0-32 (i thing) On archlinux i am on 0-5.1-1 from aur, and is working fine.

thecodecrusher commented 2 years ago

Hi, i have the same problem on my raspberry pi. same version (libmpv1).

musicfunfan commented 2 years ago

I thing is just old (libmpv1) i do not have the knowledge yet to use a new one, on stable distros like Linux Mint but on archlinux and i thing (not tested yet) on new Ubuntu lts 22.04. Is working fine.

I do not know what you running on the pi but try to use something more up to date. And see if it works. I do not thing is possible to work with the old libmpv anyway.

BrianPugh commented 2 years ago

for now, i'm just using an older version of python-mpv to go along with the older libmpv1 on my raspberry pi:

sudo apt install libmpv-dev=0.32.0-3
python-mpv==0.5.2
musicfunfan commented 2 years ago

Yea i just want to package my app as appimage so i can use it on many distros but i do not know where i can find the binary my app needs coz i use system dependencies and i do not know to put them in the appimage.

:(

woodruffw commented 2 years ago

I'm also seeing this, also on mpv 0.32.0 (the current Ubuntu 20.04 LTS version). It'd be nice if this package could selectively access this symbol!

mpv 0.32.0 Copyright © 2000-2020 mpv/MPlayer/mplayer2 projects
 built on UNKNOWN
ffmpeg library versions:
   libavutil       56.31.100
   libavcodec      58.54.100
   libavformat     58.29.100
   libswscale      5.5.100
   libavfilter     7.57.100
   libswresample   3.5.100
ffmpeg version: 4.2.4-1ubuntu0.1
eichblatt commented 2 years ago

I'm also seeing this problem on the Raspberry Pi. I would love to have the new version (in particular the timeout to the wait_until_playing() and wait_until_paused() functions).

Thank you for python-mpv, by the way. I love it!

musicfunfan commented 2 years ago

You can use :

sudo apt install libmpv-dev=0.32.0-3
python-mpv==0.5.2

As @BrianPugh said above this is working for me on Linux Mint

eichblatt commented 2 years ago

You can use :

sudo apt install libmpv-dev=0.32.0-3
python-mpv==0.5.2

As @BrianPugh said above this is working for me on Linux Mint

Thank you.

Yes, pinning the release to 0.5.2 works on the Raspberry Pi. I haven't had to pin back the version of libmpv-dev yet...I don't think anyone has updated it for the Pi recently, which is probably the reason that the newer version of python-mpv is failing on the Pi.

Hopefully, when/if a new libmpv-dev comes out for the Pi, I will be able to use the latest version of python-mpv.

jaseg commented 2 years ago

Hi there, I'll merge the version check PR to make this error human-readable.

I'll not add compatibility workarounds to deal with libmpvs that lack these symbols, since that would need a lot of code (and a lot of testing). Right now, I test every release against a recent libmpv (no more than a few weeks old).

As far as I am concerned, using an older python-mpv in case you can't easily update your limpv is totally fine. You're going to lack some newer APIs such as async calls, but older libmpvs might not have those anyway. In general, python-mpv has been stable for a long time now, so older versions are going to do a decent job.