[solved]Getting ModuleNotFoundError of cv2 while deploying

Already there are more answers for this questions , i tried everything but nothing worked. while i try to deploy my app, i am getting the error of ‘cv2 not found’.
anyone help me to solve this error ?

app link - https://faceattendance.streamlit.app/
public repo - GitHub - swaminathan33/faceattendance


ModuleNotFoundError: This app has encountered an error. The original error message is redacted to prevent data leaks. Full error details have been recorded in the logs (if you’re on Streamlit Cloud, click on ‘Manage app’ in the lower right of your app).


File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 534, in _run_script
    exec(code, module.__dict__)File "/mount/src/faceattendance/main.py", line 4, in <module>
    import cv2


I didn’t see a packages.txt to handle the non-Python dependencies in your repo. If you search for cv2 in the forum, there are a few examples. Try adding a packages.txt file like here:

Thank you . It worked .

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