Skip to content

VidCutter 3.0.0 AppImage cannot find libmpv in the usual places #12

@probonopd

Description

@probonopd

Python fails to import mpv.

me@host:~$ '/home/me/Downloads/VidCutter-3.0.0-linux-x64.AppImage' 
Traceback (most recent call last):
  File "/tmp/.mount_jgstZG/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "/tmp/.mount_jgstZG/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/tmp/.mount_jgstZG/usr/lib/python3/dist-packages/vidcutter/__main__.py", line 37, in <module>
    from vidcutter.videocutter import VideoCutter
  File "/tmp/.mount_jgstZG/usr/lib/python3/dist-packages/vidcutter/videocutter.py", line 40, in <module>
    import vidcutter.mpv as mpv
  File "/tmp/.mount_jgstZG/usr/lib/python3/dist-packages/vidcutter/mpv.py", line 29, in <module>
    raise OSError("Cannot find libmpv in the usual places.")
OSError: Cannot find libmpv in the usual places.

This is the offending code:

sofile = ctypes.util.find_library('mpv')

According to https://docs.python.org/3/library/ctypes.html

On Linux, find_library() tries to run external programs (/sbin/ldconfig, gcc, objdump and ld) to find the library file. It returns the filename of the library file.

Changed in version 3.6: On Linux, the value of the environment variable LD_LIBRARY_PATH is used when searching for libraries, if a library cannot be found by any other means.

Since your AppImage bundles 3.5, it ignores LD_LIBRARY_PATH. So this falls down for relocatable bundles like AppImages.

Can you change the Python code to load the library using a path relative to the file loading it?

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions