ImportError: libGL.so.1: cannot open shared object file: No such file or directory

Kevin Zhu 26 Reputation points
2020-10-16T18:31:49.14+00:00

Hi fellow experts,

I hope you're doing well.
I'm currently experiencing an issue with azure - I cannot import module cv2 because there's an ImportError: libGL.so.1. I've searched far and wide on the web but nothing really seems to help me. See the picture below.
33042-image.png
I'm running my FLASK application from sublime text and the command terminal, and I've successfully deployed this application to Azure. See the picture below.
32983-image.png

I really don't understand what I need to do in order to resolve this issue, and I'm not understanding some of the forum solutions people are posting towards this question. I'm very new to web development and I was hoping I could get your help on this.

To see my full code, here is the link to it: https://github.com/kevinzhu99/imageView
If you know of any solutions to this problem, or any questions you have with my problem to gain more context, please let me know and I will get back to you as soon as possible.

Thank you in advance!

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,930 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Ryan Hill 30,281 Reputation points Microsoft Employee Moderator
    2020-10-20T19:15:21.967+00:00

    Hi @Kevin Zhu ,

    Please see the answer I posted here with regards to missing modules.

    I also noticed shnGetCamImg wil fail because cameraip is not being set if the request method is GET. Your if condition terminates after pic_type = (request.form['picOptions']).

    1 person found this answer helpful.

  2. Arnaud De Jaegher 6 Reputation points
    2021-02-18T09:05:00.59+00:00

    DOCKERFILE

    FROM python:3

    RUN pip install --upgrade pip

    build variables.

    ENV DEBIAN_FRONTEND noninteractive

    install Microsoft SQL Server requirements.

    ENV ACCEPT_EULA=Y
    RUN apt-get update -y && apt-get update \
    && apt-get install -y --no-install-recommends curl gcc g++ gnupg unixodbc-dev

    Add SQL Server ODBC Driver 17 for Ubuntu 18.04

    RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
    && curl https://packages.microsoft.com/config/debian/10/prod.list > /etc/apt/sources.list.d/mssql-release.list \
    && apt-get update \
    && apt-get install -y --no-install-recommends --allow-unauthenticated msodbcsql17 mssql-tools \
    && echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile \
    && echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc

    RUN apt install libgl1-mesa-glx -y
    RUN apt-get install 'ffmpeg'\
    'libsm6'\
    'libxext6' -y

    WORKDIR /app

    COPY . /app

    RUN pip --no-cache-dir install -r requirements.txt

    EXPOSE 5000

    ENTRYPOINT ["python3"]
    CMD ["run.py"]


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.