Issues deploying an app with cv2 and mediapipe

Apart from this the streamlit complier showing this message

2023-05-26 11:11:25.634 "sans-serif" is an invalid value for theme.font. Allowed values include ['sans serif', 'serif', 'monospace']. Setting theme.font to "sans serif".
2023-05-26 11:11:25.642 Uncaught app exception
Traceback (most recent call last):
  File "/home/appuser/venv/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script
    exec(code, module.__dict__)
  File "/app/musicoo-facial-ml-module/app.py", line 5, in <module>
    import cv2
ImportError: libGL.so.1: cannot open shared object file: No such file or directory

Here is my Github Repo Link:- GitHub - Shivamlfc9/Musicoo-Facial-ML-Module: With the help Emotion/ Expression of users the Model Recommendations Music/Songs.

my requirements.txt items are listed bellow
absl-py==1.4.0
aioice==0.9.0
aiortc==1.5.0
altair==4.2.2
astunparse==1.6.3
async-timeout==4.0.2
attrs==23.1.0
av==10.0.0
blinker==1.6.2
cachetools==5.3.0
certifi==2023.5.7
cffi==1.15.1
charset-normalizer==3.1.0
click==8.1.3
colorama==0.4.6
configparser==5.3.0
contourpy==1.0.7
cryptography==40.0.2
cycler==0.11.0
decorator==5.1.1
dnspython==2.3.0
entrypoints==0.4
Flask==2.3.2
flatbuffers==23.5.9
fonttools==4.39.4
future==0.18.3
gast==0.4.0
gitdb==4.0.10
GitPython==3.1.31
google-auth==2.19.0
google-auth-oauthlib==1.0.0
google-crc32c==1.5.0
google-pasta==0.2.0
grpcio==1.54.2
gunicorn==20.1.0
h5py==3.8.0
idna==3.4
ifaddr==0.2.0
importlib-metadata==6.6.0
itsdangerous==2.1.2
jax==0.4.10
Jinja2==3.1.2
jsonschema==4.17.3
keras==2.12.0
kiwisolver==1.4.4
libclang==16.0.0
Markdown==3.4.3
markdown-it-py==2.2.0
MarkupSafe==2.1.2
matplotlib==3.7.1
mdurl==0.1.2
mediapipe==0.10.0
ml-dtypes==0.1.0
msvc-runtime==14.34.31931
numexpr==2.8.4
numpy==1.23.5
oauthlib==3.2.2
opencv-contrib-python==4.7.0.72
opencv-python==4.7.0.72
opencv-python-headless==4.7.0.72
opt-einsum==3.3.0
packaging==23.1
pandas==2.0.1
pandastable==0.13.1
Pillow==9.5.0
protobuf==3.20.3
pyarrow==12.0.0
pyasn1==0.5.0
pyasn1-modules==0.3.0
pycparser==2.21
pydeck==0.8.1b0
pyee==9.1.0
Pygments==2.15.1
pylibsrtp==0.8.0
Pympler==1.0.1
pyOpenSSL==23.1.1
pyparsing==3.0.9
pyrsistent==0.19.3
python-dateutil==2.8.2
pytz==2023.3
redis==4.5.5
requests==2.31.0
requests-oauthlib==1.3.1
rich==13.3.5
rsa==4.9
scipy==1.10.1
six==1.16.0
smmap==5.0.0
sounddevice==0.4.6
spotipy==2.23.0
streamlit==1.22.0
streamlit-webrtc==0.45.0
tenacity==8.2.2
tensorboard==2.12.3
tensorboard-data-server==0.7.0
tensorflow==2.12.0
tensorflow-estimator==2.12.0
tensorflow-intel==2.12.0
tensorflow-io-gcs-filesystem==0.31.0
termcolor==2.3.0
toml==0.10.2
toolz==0.12.0
tornado==6.3.2
typing_extensions==4.6.2
tzdata==2023.3
tzlocal==5.0.1
urllib3==1.26.16
validators==0.20.0
watchdog==3.0.0
Werkzeug==2.3.4
wrapt==1.14.1
xlrd==2.0.1
zipp==3.15.0

please help me out…

  • cleanup your requirements.txt file, you probably don’t need most of the packages
  • regarding cv2 issues, see thread below, you probably have to use other packages in packages.txt

Tysm Bro! Its Solved but now i am getting another error:-

Can you suggest me how to clear it

st.image(".\Images\logo.png" , width=530, use_column_width=True)

Don’t use (windows) strings for any file paths.

What Should I use instead

You probably never use Linux/Unix-like system to ask this question :slight_smile:
On those systems, we use slash (/) and not backslash (\) on file pathes.

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