Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error while loading shared libraries: libmpv.so.1: cannot open shared object file: No such file or directory

I've installed flet through "pip install flet" from the terminal on Ubuntu. Upon running the basic flet code, just to check whether it worked this pops up:

error while loading shared libraries: libmpv.so.1: cannot open shared object file: No such file or directory

The code I ran is:

import flet as ft

def main(page: ft.Page):
    # add/update controls on Page
    pass

ft.app(target=main)

I also followed the Linux system instructions from terminal to install flet:

sudo apt-get update
sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio`

What can I try next? I'm relatively new to Ubuntu.

I expected a basic flet window to pop up, and not an error from the terminal. Something like:

basic flet window the code was supposed to create

Instead I got the error:

error while loading shared libraries: libmpv.so.1: cannot open shared object file: No such file or directory

like image 268
staff1515 Avatar asked Feb 03 '26 13:02

staff1515


1 Answers

In Ubuntu 24.04 LTS, I got the same error and solved it with this:

sudo apt update

sudo apt install libmpv-dev libmpv2

sudo ln -s /usr/lib/x86_64-linux-gnu/libmpv.so /usr/lib/libmpv.so.1

Credit to this YouTube tutorial.

like image 173
Henry Areiza Avatar answered Feb 06 '26 03:02

Henry Areiza