如何解决尝试在容器上运行 openCV/pillow 时,为什么会出现此错误?
我有一个可以在本地执行但不能在 docker 容器中执行的程序。运行时
image=cv2.imread(input_file_path)
我明白了:
libpng warning: Duplicate iCCP chunk
程序在几秒钟后终止。如果我尝试安装 Pillow 6.1.0(与我在本地安装的版本相同),则在尝试执行 docker build 时会出现此错误:
The headers or library files could not be found for jpeg,a required dependency when compiling Pillow from source.
Please see the install instructions at:
https://pillow.readthedocs.io/en/latest/installation.html
但一直无法解决问题。
需求.txt:
boto3==1.14.46
imutils==0.5.4
opencv-python==4.5.1.48
urllib3==1.25.10
Dockerfile:
FROM continuumio/miniconda3
COPY . /
WORKDIR /
RUN pip install --upgrade pip setuptools wheel
ADD requirements.txt /tmp/requirements.txt
RUN pip install -r /tmp/requirements.txt && rm /tmp/requirements.txt
RUN pip install Pillow
RUN apt-get update
RUN apt-get install ffmpeg libsm6 libxext6 -y
ENTRYPOINT ["python","main.py"]
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。