eichblatt / deadstream

A time machine to play GD tapes from archive.org
GNU General Public License v3.0
51 stars 14 forks source link

mpv import error #268

Closed jmsaltzman closed 2 years ago

jmsaltzman commented 2 years ago

Running testplayer.py or other examples get hung up trying to import mpv.MPV:

pi:~/projects/deadstream/timemachine $python3 -m testplayer.py
Traceback (most recent call last):
  File "/usr/lib/python3.9/runpy.py", line 188, in _run_module_as_main  
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)  
  File "/usr/lib/python3.9/runpy.py", line 111, in _get_module_details  
    __import__(pkg_name)
  File "/home/pi/projects/deadstream/timemachine/testplayer.py", line 4, in <module>
    from timemachine import Archivary,config,GD
  File "/home/pi/.local/lib/python3.9/site-packages/timemachine/GD.py", line 22, in <module>
    from mpv import MPV
  File "/home/pi/.local/lib/python3.9/site-packages/mpv.py", line 49, in <module>
    raise OSError("Cannot find libmpv in the usual places. Depending on your distro, you may try installing an "
OSError: Cannot find libmpv in the usual places. Depending on your distro, you may try installing an mpv-devel or mpv-libs package. If you have libmpv around but this script can't find it, consult the documentation for ctypes.util.find_library which this script uses to look up the library filename.

This is on a 4GB Pi 4 with a fresh Raspbian install, no errors on the pip install.

Edit: apologies for filing this here, wasn't sure of the best way to ask about this! I have a PCB order in and am trying to set up the Pi first without it, to run the time machine from the command line to get back to 1977 pronto. I'll keep messing with it to see what I can do, first by digging into python-mpv, maybe trying an older version.

eichblatt commented 2 years ago

I think this will be solved by installing an mpv-devel or mpv-libs package.

jmsaltzman commented 2 years ago

Yep it turns out it's just a python-mpv problem :D

That message is a dead end-- those packages don't exist-- but installing "libmpv1" on the Pi installed the required libmpv.so that the Python package needs:

sudo apt-get install libmpv1

All set now