Importerror: libgl.so.1: cannot open shared object file: no such file or directory opencv error

importerror: libgl.so.1: cannot open shared object file: no such file or directory

I’m getting this error while installing opencv python on streamlit share how to resolve it.

Hi @harish_natarajan,

I will need a bit more information to understand whats happening here. You are trying to launch an app on streamlit share and you’re getting an import error?

Can you link your github repo here so we can see what is happening?

Can you also generate a minimum working example of code that produces this error will help us get to a solution faster! :racing_car: :racing_car: :racing_car:

Happy Streamlit-ing!
Marisa

Thanks @Marisa_Smith here is the GitHub link https://github.com/N-Harish/opencv-demo Yes when I deploy my app on streamlit share I get the above error.

1 Like

Hi @harish_natarajan -

For errors like this, around packages that are system-level, you need to add a packages.txt file to install drivers via the package manager:

For opengl issues specifically, this should resolve your issue:

2 Likes

Thanks @randyzwitch . It worked when I added packages.txt in my git repo. You guys are doing a great job developing streamlit and launching streamlit share. Thanks a lot.

Regards
Harish

2 Likes