Skip to main content

Linux system libraries

On Linux, a Flet app loads some libraries from the system instead of shipping them, such as GTK, GStreamer, libmpv and WebKitGTK. Which ones it needs depends on the extensions it includes, so they have to be installed on every machine that runs it.

What you need to install​

You areWhat to install
Running an app with flet run, or an app made with flet pack, on the default light desktop clientlibgtk-3-0 and libsecret-1-0, which desktop installations normally include.
Running an app on the full desktop clientThe runtime packages of every extension the full client includes, even ones your app doesn't use. See Full desktop client.
Building an app with flet build linuxThe build prerequisites, plus the build packages of the extensions your app uses that they leave out (see the table below).
Shipping an app built with flet build linuxNothing on your side: your users need the runtime packages of the extensions your app uses. Declare them in your .deb or .rpm (see Distributing) so the package manager installs them.

Libraries by extension​

ExtensionDesktop client flavorRuntime package (Debian, Ubuntu)Build package (Debian, Ubuntu)Oldest distribution
Every Flet applight, fulllibgtk-3-0libgtk-3-dev and the rest of the build prerequisitesEvery supported one
flet-secure-storagelight, fulllibsecret-1-0libsecret-1-devEvery supported one
flet-audiofulllibgstreamer-plugins-base1.0-0, and the GStreamer plugins for the formats you play, such as gstreamer1.0-plugins-goodlibgstreamer1.0-dev, libgstreamer-plugins-base1.0-devEvery supported one
flet-videofulllibmpv2 on Debian 12+ and Ubuntu 24.04+; libmpv1 on earlier releaseslibmpv-devEvery supported one
flet-webviewfull, on Debian 12+ and Ubuntu 22.04+libwebkit2gtk-4.1-0libwebkit2gtk-4.1-devDebian 12, Ubuntu 22.04
flet-rivefull, on Ubuntu 24.04 x86-64NoneNoneUbuntu 24.04

The build prerequisites already include every build package above except libwebkit2gtk-4.1-dev, which is unavailable before Debian 12 and Ubuntu 22.04.

Full desktop client​

The full client includes every extension marked "full" above, so it does not start until their runtime packages are installed too, next to the light client's libgtk-3-0 and libsecret-1-0, even for an app that uses none of them. To use it, set FLET_DESKTOP_FLAVOR=full or desktop_flavor = "full" under [tool.flet] in pyproject.toml, and install:

Also Raspberry Pi OS (Bookworm):

sudo apt install libmpv2 libgstreamer-plugins-base1.0-0 libwebkit2gtk-4.1-0

Flet downloads the client build that matches your system's glibc version, and that build expects the libmpv version your distribution ships, so no libmpv.so.1 symlink is needed. If you created one for an older Flet version, remove it.

When a library is missing​

A missing library stops an app built with flet build linux before any of its code runs: no window opens, and the app exits with status 127. Run from a terminal, it prints the library the system could not find:

error while loading shared libraries: libwebkit2gtk-4.1.so.0: cannot open shared object file: No such file or directory

Started from the application launcher, it shows nothing at all. The app cannot catch this itself, so make sure the libraries are installed before it runs: declare them as dependencies of your .deb or .rpm, and list them for users of other formats, such as an AppImage or a tarball.

With flet run and flet pack, the same happens to the desktop client, so your app's main() never runs. Flet then prints the loader error and a hint naming the packages the client needs.