Encountered the following error:
opencv ImportError: libGL.so.1: cannot open shared object file: No such file or directory
Wrong tutorial: 👉 Install opencv in docker environment ImportError: libGL.so.1: cannot open shared object file: No such file or directory
🤡🤡🤡🤡🤡🤡🤡🤡🤡🤡🤡🤡🤡🤡🤡🤡🤡🤡🤡🤡🤡🤡🤡🤡🤡🤡🤡🤡🤡
Correct tutorial:👇
FROM python:3.9-buster
RUN (apt-get update) && (apt-get install -y libgl1-mesa-dev ffmpeg libsm6 libxext6)
ENV PYTHONUNBUFFERED 1
RUN mkdir /code
WORKDIR /code
COPY requirements.txt /code/
RUN (/usr/local/bin/python -m pip install --upgrade pip -i https://mirrors.aliyun.com/pypi/simple) && (pip install -i https://mirrors.aliyun.com/pypi/simple -r requirements.txt)
COPY . /code/
Just install these four things: libgl1-mesa-dev
, ffmpeg
, libsm6
, libxext6
Don't changeopencv-python
toopencv-python-headless
, this is a very brainless practice
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。