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.
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.
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!
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.
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:
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
Hi but this isnt working now
E: Unable to locate package freeglut3-dev
E: Unable to locate package libgtk2.0-dev
E: Couldn't find any package by glob 'libgtk2.0-dev
'
E: Couldn't find any package by regex 'libgtk2.0-dev
'
Stopping...
did the same but nothing happening
face_more_web/packages.txt at master · arnavmehta7/face_more_web (github.com)
code above
plz assist
ImportError: libGL.so.1: cannot open shared object file: No such file or directory
Traceback:
File "/home/appuser/.local/lib/python3.7/site-packages/streamlit/script_runner.py", line 332, in _run_script
exec(code, module.__dict__)File "/app/face_more_web/app.py", line 3, in <module>
import cv2File "/home/appuser/.local/lib/python3.7/site-packages/cv2/__init__.py", line 5, in <module>
from .cv2 import *
further errors
Hi @arnavmehta7, welcome to the Streamlit community.
From the files you linked, it appears you are trying to deploy on Heroku. The packages.txt
setup file is for Streamlit sharing.
Best,
Randy
No sir… I tried to deploy there as well as well as here… But the same problem
You also have this line
I don’t know for certain, but I suspect that having two -
before headless breaks the pip install, which keeps the process from installing correctly. What do your installation logs show (it’s the icon on the bottom right of Streamlit share)
Although it didn’t did anything wrong and i worked as soon i added headless and thanks everyone… I deployed 3 my websites which was pretty hard earlier now i know the process… THANKS!.. this is better than Heroku…!!! love streamlit… Continue adding more things❤️
Hey @ArunRengaraman did you specify matplotlib in requirements file?
Hello i think you does not have the package installed called matplotlib in your github repository make a requirements file with the name matplotlib… I’ve done the same project https://share.streamlit.io/arnavmehta7/lung_disease_web/main/st11.py check the source code of this one you will find the requirements file
yes … i have
I have added matplotlib in requirements file… please check it out…
Everything looks fine… Try to re deploy… And in the requirements file it should be opencv-python-headless nor opencv_python_headless
Still getting the same issue…
Hello,
Just for the info, I was facing the same error, adding packages.txt didn’t resolve the issue for me, but replacing opencv-python with opencv-python-headless in requirements.txt solved the issue.
Thanks for all the help
Thank You so much @randyzwitch , this fixed my issue.
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.