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

PyQt embedding example fails #184

Closed probonopd closed 2 years ago

probonopd commented 2 years ago

On FreeBSD 12.2 with mpv 0.33.1_8,1 and the latest python-mpv from pip, I get:

Traceback (most recent call last):
  File "/home/user/Desktop/Media Player.app/Media Player", line 27, in <module>
    win = Test()
  File "/home/user/Desktop/Media Player.app/Media Player", line 15, in __init__
    player = mpv.MPV(wid=str(int(self.container.winId())),
  File "/usr/home/user/Desktop/Media Player.app/mpv.py", line 302, in __init__
    _mpv_set_option_string(self.handle, k.replace('_', '-').encode(), istr(v).encode())
  File "/usr/home/user/Desktop/Media Player.app/mpv.py", line 174, in wrapper
Exception in callback MPV.__init__.<locals>.mpv_event_extractor() at /usr/home/user/Desktop/Media Player.app/mpv.py:276
handle: <Handle MPV.__init__.<locals>.mpv_event_extractor() at /usr/home/user/Desktop/Media Player.app/mpv.py:276>
Traceback (most recent call last):
  File "/usr/home/user/Desktop/Media Player.app/mpv.py", line 254, in _event_generator
    raise StopIteration()
StopIteration

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/home/user/Desktop/Media Player.app/mpv.py", line 278, in mpv_event_extractor
    for event in _event_generator(self.handle):
RuntimeError: generator raised StopIteration
    ErrorCode.raise_for_ec(func, *args)
  File "/usr/home/user/Desktop/Media Player.app/mpv.py", line 59, in raise_for_ec
    raise ex(ec, *args)
AttributeError: ('mpv option does not exist', -5, <MpvHandle object at 0x80afb92c0>, b'log-handler', b'<built-in function print>')
neinseg commented 2 years ago

You may have done pip install mpv instead of pip install python-mpv. The mpv pypi package is a really, really old version of this and not published by me.

probonopd commented 2 years ago

You are completely right.

sudo python3 -m pip uninstall mpv
sudo python3 -m pip install python-mpv

fixed it for me.

Maybe mpv should be removed from PyPI. Thank you very much.