Import Error: Deploying custom Pytorch Model on streamlit
Please, so trying to deploy a custom Pytorch based web-app on streamlit, everything works locally, however when deployed, I find the following Error in the Logs:
Downloading: &quot;https://github.com/ultralytics/yolov5/archive/master.zip&quot; to /home/appuser/.cache/torch/hub/master.zip
2022-08-14 12:23:17.584 Uncaught app exception
Traceback (most recent call last):
  File &quot;/home/appuser/venv/lib/python3.9/site-packages/streamlit/scriptrunner/script_runner.py&quot;, line 557, in _run_script
    exec(code, module.__dict__)
  File &quot;app.py&quot;, line 28, in &lt;module&gt;
    model = torch.hub.load('ultralytics/yolov5', 'custom', path=run_model_path)
  File &quot;/home/appuser/venv/lib/python3.9/site-packages/torch/hub.py&quot;, line 339, in load
    model = _load_local(repo_or_dir, model, *args, **kwargs)
  File &quot;/home/appuser/venv/lib/python3.9/site-packages/torch/hub.py&quot;, line 368, in _load_local
    model = entry(*args, **kwargs)
  File &quot;/home/appuser/.cache/torch/hub/ultralytics_yolov5_master/hubconf.py&quot;, line 74, in custom
    return _create(path, autoshape=autoshape, verbose=_verbose, device=device)
  File &quot;/home/appuser/.cache/torch/hub/ultralytics_yolov5_master/hubconf.py&quot;, line 31, in _create
    from models.common import AutoShape, DetectMultiBackend
  File &quot;/home/appuser/.cache/torch/hub/ultralytics_yolov5_master/models/common.py&quot;, line 14, in &lt;module&gt;
    import cv2
  File &quot;/home/appuser/venv/lib/python3.9/site-packages/cv2/__init__.py&quot;, line 5, in &lt;module&gt;
    from .cv2 import *
ImportError: libGL.so.1: cannot open shared object file: No such file or directory

Here's what the requrements.txt contains:
pillow&lt;=9.2.0
numpy&lt;=1.21.0
streamlit==1.11.0
torch&lt;=1.8.2+cu111
opencv&lt;=4.5.1

Would love your assistance.

If you're deploying the app, opencv-python-headless would be the appropriate package rather than opencv
