flet-dev / flet-dev/flet

libmpv.so.1 not found (when libmpv is already installed) - fixable but hacky

Open
#2,823 35 comments 23 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

platform: linux
Dominant language
Python
Stars
17k
Forks
694
Avg merge
1d 14h
Merged PRs (30d)
33

Description

The problem

error while loading shared libraries: libmpv.so.1

$ python counter.py
/home/user/.flet/bin/flet-0.21.1/flet/flet: error while loading shared libraries: libmpv.so.1: cannot open shared object file: No such file or directory
Traceback (most recent call last):
  File "/home/user/code/flet/counter.py", line 29, in <module>
    flet.app(target=main)
  File "/home/user/code/flet/.venv/lib/python3.11/site-packages/flet_runtime/app.py", line 70, in app
    return asyncio.run(
           ^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/home/user/code/flet/.venv/lib/python3.11/site-packages/flet_runtime/app.py", line 207, in app_async
    await conn.close()
  File "/home/user/code/flet/.venv/lib/python3.11/site-packages/flet_runtime/flet_socket_server.py", line 191, in close
    if self.__receive_loop_task:
       ^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'FletSocketServer' object has no attribute '_FletSocketServer__receive_loop_task'. Did you mean: '_FletSocketServer__receive_loop'?

However, mpv is installed on the system (linux Arch):

$ ls -l /usr/lib/libmpv.so*
libmpv.so        libmpv.so.2      libmpv.so.2.2.0

The hacky fix

so a quick symlink can fix the problem:

 sudo ln -s /usr/lib/libmpv.so /usr/lib/libmpv.so.1

and then it works but I am sure the dependency resolution could figure this out on its own without this kind solution.

(side note: just found about Flet today, it looks amazing, can't wait to give a go with a real project)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported python counter.py failure on Arch Linux and review the 35-comment thread for the current understanding of libmpv discovery. Trace how the Flet desktop executable locates shared libraries; done means an installed compatible libmpv is found without manually creating /usr/lib/libmpv.so.1.

Written by the indexing model from the issue text.

Assessment

Tech stack
arch-linux, linux, python
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.