5

I have a flask-app that contains some OpenCV methods, I tested it locally and it's working fine, then I deployed this app to Azure using a web app and it successfully deployed, but when I hit the given URL then this error is showing on the browser:

:( Application Error If you are the application administrator, you can access the diagnostic resources.

and when I check the log file then this error is being shown:

from cv2 import * ImportError: libGL.so.1: cannot open shared object file: No such file or directory

1 Answers1

1
  1. In requirements.txt use opencv-python-headless==4.5.1.48 instead of opencv-contrib-python==4.5.1.48.
  2. If the above method does not work, build a custom docker image on top of AML base images(i.e. mcr.microsoft.com/azureml/base-gpu:0.2.4) and include the mesa's GL library in conda using conda_packages=['mesa-libgl-cos6-x86_64']

This is related to this ImportError: libSM.so.6: cannot open shared object file: No such file or directory

Vishal Singh
  • 1,341
  • 14
  • 13