遇到下面的錯誤:
opencv ImportError: libGL.so.1: cannot open shared object file: No such file or directory
錯誤的教程:? docker環境裡安裝opencv ImportError: libGL.so.1: cannot open shared object file: No such file or directory
?????????????????????????????
正確的教程:?
FROM python:3.9-buster
ENV PYTHONUNBUFFERED 1
RUN mkdir /code
WORKDIR /code
COPY requirements.txt /code/
RUN (apt-get update) && (apt-get install -y libgl1-mesa-dev ffmpeg libsm6 libxext6)
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/
安裝這四個東西就好了:libgl1-mesa-dev
、 ffmpeg
、 libsm6
、 libxext6
不要把 opencv-python 改為 opencv-python-headless