Can't run Flet on manjaro

I’m trying to run Flet ( https://github.com/flet-dev/flet) on manjaro KDE but i’m getting the error error while loading shared libraries: libmujs.so.2: cannot open shared object file: No such file or directory.
I posted this issue on their github but i didn’t get an answer: https://github.com/flet-dev/flet/issues/2768
I have the required dependencies installed:
mpv, mujs and turbojpeg
i have mujs installed but don’t have the specific lib version (libmujs.so.2).
Does someone known what package do i have to install to get it?

Well there is the AUR.

But as I am guessing you have an ‘old’ muj because you are on the Stable branch, I dont know if the Arch User Repository is the best suggestion.

But heres the wiki on both the AUR and the Branches;

1 Like

Welcome to the forum! :wave:

It’s in the AUR (Arch User Repository) as python-flet.

python-flet does not depend on mujs.

How? What do you need it for?

❯ pacman -Ss mujs
extra/mujs 1.3.4-1 [installed]
    An embeddable Javascript interpreter in C
extra/python-mujson 1.4-6
    Use the fastest JSON functions available at import time

my version of mujs

I just edited my reply above after I realized python-flet does not depend on mujs.

I’m just trying the basic example from flet docs:

import flet as ft

def main(page: ft.Page):
    pass

ft.app(target=main)

I’m not a programmer or software engineer. I’m just trying to learn flet to convert some Libreoffice calc sheets to python desktop apps. ( I have a CRUD system and an Inventory Control made with macros on calc)
And a found Flet easier to learn than the other Python gui libs.

we can install flet lib with pip (it’s ok on my manjaro stable) But, install only in home or venv

I’m running from a venv and still getting an error:

python -u "/mnt/dados/Linux/Python/projetos/flet/flet_example.py"
source /mnt/dados/Linux/Python/projetos/flet/venv/bin/activate
❯ python -u "/mnt/dados/Linux/Python/projetos/flet/flet_example.py"
Traceback (most recent call last):
  File "/mnt/dados/Linux/Python/projetos/flet/flet_example.py", line 1, in <module>
    import flet as ft
ModuleNotFoundError: No module named 'flet'
❯ source /mnt/dados/Linux/Python/projetos/flet/venv/bin/activate
❯ python -u "/mnt/dados/Linux/Python/projetos/flet/flet_example.py"
/home/leo/.flet/bin/flet-0.20.2/flet/flet: error while loading shared libraries: libmujs.so.2: cannot open shared object file: No such file or directory

/home/leo/.flet/bin/flet-0.20.2

bad version ! 0.20 is too old pip install --upgrade flet

pip show flet
Name: flet
Version: 0.22.0
ls -l /home/patrick/.flet/bin/
drwxr-xr-x 3 patrick users 4096 25 mars  12:39 flet-0.21.2/
drwxr-xr-x 3 patrick users 4096 21 avril 22:07 flet-0.22.0/
drwxr-xr-x 3 patrick users 4096 11 déc.   2022 flet-0.2.4/
drwxr-xr-x 3 patrick users 4096  9 avril  2023 flet-0.5.0/

Neither am I. I’m mostly just a software packager, so I found the package you would normally need. However, it seems this is an issue with your local environment.

@linux-aarhus & @papajoke are probably the most knowledgeable about Python around here. The former has created multiple Tutorials, in fact.

what is the package? It contains libmujs.so.2?

:wink:

No, no package does.

Good point. The latest version os 0.22.0.

That’s a local package, so don’t mix system and local Python packages.

my bad. thank you.
Since @papajoke mention i have a bad version of flet, i’m deleting my flet venv and installing again to see it will solve the problem. If not i will try python-flet.

updating my venv didn’t solve the problem:

❯ pip show flet
Name: flet
Version: 0.22.0
Summary: Flet for Python - easily build interactive multi-platform apps in Python
Home-page: 
Author: Appveyor Systems Inc.
Author-email: hello@flet.dev
License: Apache-2.0
Location: /mnt/dados/Linux/Python/projetos/flet/venv/lib/python3.11/site-packages
Requires: cookiecutter, fastapi, flet-runtime, packaging, qrcode, uvicorn, watchdog
Required-by: 
❯ python -u "/mnt/dados/Linux/Python/projetos/flet/flet_example.py"
/home/leo/.flet/bin/flet-0.22.0/flet/flet: error while loading shared libraries: libmujs.so.2: cannot open shared object file: No such file or directory
❯ ls -lha /home/leo/.flet/bin
Permissions Size User Date Modified Name
drwxr-xr-x     - leo  25 fev 18:26   flet-0.20.2
drwxr-xr-x     - leo  21 abr 17:47   flet-0.22.0

now i got this error while trying to install python-flet:

==> ERROR: One or more files did not pass the validity check!
 -> Failed to install layer, going to the next layer.error:error constructing: python-copier - exit status 1 
==> Creating the package: python-copier 9.2.0-1 (Sun 21 Apr 2024 18:31:14) 
==> Checking Runtime Dependencies... ==> Checking compile-time dependencies... 
==> Getting sources...
-> Updating git copier repository 
==> Validating source files with sha256sums... copier... NOT FOUND 
==> ERROR: One or more files did not pass the validity check! 
-> error when constructing: python-copier-exit status 1 
==> Creating the package: python-flet 0.22.0-1 (Sun 21 Apr 2024 18:31:15) 
==> Checking Runtime Dependencies... 
==> Missing dependencies: 
-> python-copier 
==> Checking compile-time dependencies... 
==> ERROR: Unable to resolve all dependencies. 
-> error constructing: python-flet-exit status 8 
-> Failed to install the following packages. Manual intervention is required: 
python-copier - exit status 1 
python-flet - exit status 8

You have Flet installed locally, I suggest updating it there instead of the AUR (Arch User Repository) package–especially since you are apparently not familiar with using the AUR.

Again…

in aur : mpv is a dep
for flet, mpv is optional

you have a bad version for mpv ? (aur, dev, …)
exists some issues in flet , your bad mpv want libmujs.so.2 ?

for me, manjaro stable, it’s ok with :
flet installed by pip in home (not venv)
pacman, mpv 1:0.37.0-2 and mujs installed (no libmujs.so.2 in my system)

I had mpv-git installed. I uninstalled and installed the mpv from official repo.
I try not mess with Python libs (always install libs on venvs)
After install mpv i continue to get libmujs.so.2 error.

flet is “compiled/link” in install, remove library and re-install