我正在尝试在 Raspberry Pi 4 上的 Dockerfile 中安装 dlib。
在 Docker 之外,我可以通过运行在 Pi 上安装 dlib
pip3 install --upgrade dlib
但是当我尝试在 Dockerfile 中执行以下操作时:
FROM resin/raspberry-pi-python:3
COPY raspi.list /etc/apt/sources.list.d/raspi.list
COPY sources.list /etc/apt/sources.list
COPY pip.conf /root/.pip/pip.conf
RUN apt-get -y update
RUN apt-get install -y --fix-missing \
build-essential \
cmake \
libopenblas-dev \
liblapack-dev \
libatlas-base-dev \
libx11-dev \
libgtk-3-dev \
gfortran \
git \
wget \
curl \
graphicsmagick \
libgraphicsmagick1-dev \
libatlas-dev \
libavcodec-dev \
libavformat-dev \
libboost-all-dev \
libgtk2.0-dev \
libjpeg-dev \
liblapack-dev \
libswscale-dev \
pkg-config \
python3-dev \
zip \
&& apt-get clean && rm -rf /tmp/* /var/tmp/*
RUN python3 -m ensurepip --upgrade
RUN pip3 install --upgrade dlib
尝试构建 docker 映像时出现错误:
Step 9/12 : RUN pip3 install --upgrade dlib ---> Running in bf5fa67b254d 查看索引: http : //mirrors.aliyun.com/pypi/simple/ 收集dlib 下载 http://mirrors.aliyun.com/ pypi/packages/05/57/e8a8caa3c89a27f80bc78da39c423e2553f482a3705adc619176a3a24b36/dlib-19.17.0.tar.gz (3.4MB) 安装收集的软件包:dlib 运行 setup.py install for dlib: started Running setup.py install for dlib: finished with status 'error ' 命令的完整输出 /usr/local/bin/python3.6 -u -c "import setuptools, tokenize; file ='/tmp/pip-install-sak074zk/dlib/setup.py';f=getattr(tokenize, 'open', open)( file );code=f.read().replace('\r\n', '\n');f.close();exec(compile(code,文件, 'exec'))" install --record /tmp/pip-record-7yn41l3u/install-record.txt --single-version-externally-managed --compile: 运行 install 运行 build 运行 build_py 包初始化文件 'dlib/ init .py' 未找到(或不是常规文件)运行 build_ext Traceback(最近一次调用最后):文件“”,第 1 行,在文件“/tmp/pip-install-sak074zk/dlib/setup.py”,行261,在“主题 :: 软件开发”中,文件“ /usr/local/lib/python3.6/site-packages/setuptools/init.py”,第 129 行,在设置中返回 distutils.core.setup(**attrs) 文件“/usr/local/lib/python3.6/distutils/core.py”,第 148 行,在设置中 dist.run_commands()文件“/usr/local/lib/python3.6/distutils/dist.py”,第 955 行,在 run_commands self.run_command(cmd) 文件“/usr/local/lib/python3.6/distutils/dist.py”中,第 974 行,在 run_command cmd_obj.run() 文件“/usr/local/lib/python3.6/site-packages/setuptools/command/install.py”,第 61 行,运行中返回 orig.install.run(self ) 文件“/usr/local/lib/python3.6/distutils/command/install.py”,第 545 行,运行 self.run_command('build') 文件“/usr/local/lib/python3.6/distutils /cmd.py”,第 313 行,在 run_command self.distribution 中。run_command(command) 文件“/usr/local/lib/python3.6/distutils/dist.py”,第 974 行,在 run_command cmd_obj.run() 文件“/usr/local/lib/python3.6/distutils/command /build.py”,第 135 行,在运行 self.run_command(cmd_name) 文件“/usr/local/lib/python3.6/distutils/cmd.py”,第 313 行,在 run_command self.distribution.run_command(command)文件“/usr/local/lib/python3.6/distutils/dist.py”,第 974 行,在 run_command cmd_obj.run() 文件“/tmp/pip-install-sak074zk/dlib/setup.py”,第 129 行,在运行 cmake_version = self.get_cmake_version() 文件“/tmp/pip-install-sak074zk/dlib/setup.py”,第 120 行,在 get_cmake_version out = subprocess.check_output(['cmake', '--version']) 文件“/usr/local/lib/python3.6/subprocess.py”,第 336 行,在 check_output **kwargs).stdout 文件“/usr/local/lib/python3.6/subprocess.py”,行418,在运行输出=stdout,stderr=stderr) subprocess.CalledProcessError: Command '['cmake', '--version']' dead with .
命令“/usr/local/bin/python3.6 -u -c”导入setuptools,tokenize;file ='/tmp/pip-install-sak074zk/dlib/setup.py';f=getattr(tokenize, 'open', open)( file );code=f.read().replace('\r\n ', '\n');f.close();exec(compile(code, file , 'exec'))" install --record /tmp/pip-record-7yn41l3u/install-record.txt --single- version-externally-managed --compile" 在 /tmp/pip-install-sak074zk/dlib/ 中失败,错误代码为 1 您使用的是 pip 版本 10.0.1,但版本 19.2.3 可用。您应该考虑通过“pip install --upgrade pip”命令进行升级。命令 '/bin/sh -c pip3 install --upgrade dlib' 返回一个非零代码:1
我错过了什么?