Error, while trying to install libgl1 using packages.txt

I’m trying to use ultralytics on a streamlit app. The app runs fine locally, but during the deployment there are issues with cv2 package. After running in circles with changing the requirements.txt file (openvc-python, openvc-python-headless, etc), there another issue appeared trying to import libgl1 (cannot be opened or shared). So now I’m trying to install it, as said in solutions from other forums. But can’t do this either.

  1. Link to public app: https://recognizeyourfood.streamlit.app/
  2. Link to public repository: GitHub - iMeReJ22/food_recoginition_webapp
  3. Error message:
[22:34:19] 🐙 Pulling code changes from Github...
[22:34:20] 📦 Processing dependencies...
[22:34:20] 📦 Apt dependencies were installed from /mount/src/food_recoginition_webapp/packages.txt using apt-get.
Hit:1 http://deb.debian.org/debian bullseye InRelease
Hit:2 http://deb.debian.org/debian-security bullseye-security InRelease
Hit:3 http://deb.debian.org/debian bullseye-updates InRelease
Hit:4 https://packages.microsoft.com/debian/11/prod bullseye InRelease
Reading package lists...[2025-01-13 22:34:22.056190] 
Reading package lists...[2025-01-13 22:34:22.762191] 
Building dependency tree...[2025-01-13 22:34:22.962514] 
Reading state information...[2025-01-13 22:34:22.963015] 
E: Unable to locate package libglx-mesa0
  1. Python version: 3.11
    Streamlit version: 1.40.1

I can reproduce the issue. Which is weird, since libglx-mesa0 is available in bullseye for all archiectures I know and then some more.

Finally got a way to fix this thing. I turned out it was either a Windows or PyCharm problem. On the beginning of the first row in the packages.txt there was a hidden whitespace that was messing things up. The whitespace was’t visible neither in the Windows Notepad app, or the PyCharm editor.
Finnaly my friend opened the file with “cat -v” on her computer and noticed the whitespace. After that we used those 2 simple commands to fix the issue:

sed -i '' '1s/^\xEF\xBB\xBF//' packages.txt
sed -i '' 's/\r//' packages.txt

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.