关于docker:docker-打包-opencv报错解决方法

66次阅读

共计 609 个字符,预计需要花费 2 分钟才能阅读完成。

遇到上面的谬误:

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

正文完
 0