Flask APP on Azure is giving import cv2 ImportError: libGL.so.1: after deployment Flask APP on Azure is giving import cv2 ImportError: libGL.so.1: after deployment flask flask

Flask APP on Azure is giving import cv2 ImportError: libGL.so.1: after deployment


  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