Docker:scipy 的构建轮失败

Docker: Failed building wheel for scipy

我正在尝试在我的 raspberry pi 3 上从 (https://github.com/jamct/facerec) 进行面部识别。因此 by 使用最新版本的 Raspbian Stretch。

我是运行:

docker build -t facerec:latest .

但是我收到以下错误:

ERROR: Failed building wheel for scipy
ERROR: Could not build wheels for scipy which use PEP 517 and cannot be installed directly

这里是日志的更多内容:

  creating build/temp.linux-armv7l-3.6/scipy/fft
  creating build/temp.linux-armv7l-3.6/scipy/fft/_pocketfft
  compile options: '-DPOCKETFFT_PTHREADS -I/root/.local/include/python3.6m -I/usr/local/include/python3.6m -I/tmp/pip-build-env-u7r4c8tr/overlay/lib/python3.6/site-packages/numpy/core/include -I/usr/local/include/python3.6m -c'
  extra options: '-std=c++14 -fvisibility=hidden'
  g++: scipy/fft/_pocketfft/pypocketfft.cxx
  Running from scipy source directory.
  /tmp/pip-build-env-u7r4c8tr/overlay/lib/python3.6/site-packages/numpy/distutils/system_info.py:572: UserWarning:
      Atlas (http://math-atlas.sourceforge.net/) libraries not found.
      Directories to search for the libraries can be specified in the
      numpy/distutils/site.cfg file (section [atlas]) or by setting
      the ATLAS environment variable.
    self.calc_info()
  /tmp/pip-build-env-u7r4c8tr/overlay/lib/python3.6/site-packages/numpy/distutils/system_info.py:664: UserWarning: Specified path /usr/include/python3.6m is invalid.
    return self.get_paths(self.section, key)
  scipy/fft/_pocketfft/pypocketfft.cxx:15:31: fatal error: pybind11/pybind11.h: No such file or directory
   #include <pybind11/pybind11.h>
                                 ^
  compilation terminated.
  scipy/fft/_pocketfft/pypocketfft.cxx:15:31: fatal error: pybind11/pybind11.h: No such file or directory
   #include <pybind11/pybind11.h>
                                 ^
  compilation terminated.
  error: Command "g++ -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPOCKETFFT_PTHREADS -I/root/.local/include/python3.6m -I/usr/local/include/python3.6m -I/tmp/pip-build-env-u7r4c8tr/overlay/lib/python3.6/site-packages/numpy/core/include -I/usr/local/include/python3.6m -c scipy/fft/_pocketfft/pypocketfft.cxx -o build/temp.linux-armv7l-3.6/scipy/fft/_pocketfft/pypocketfft.o -MMD -MF build/temp.linux-armv7l-3.6/scipy/fft/_pocketfft/pypocketfft.o.d -std=c++14 -fvisibility=hidden" failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for scipy
ERROR: Could not build wheels for scipy which use PEP 517 and cannot be installed directly
The command '/bin/sh -c cd /face_recognition &&     pip3 install -r requirements.txt &&     python3 setup.py install' returned a non-zero code: 1

这是 dockerfile:

#Dockerfile for face-recognition
#Based on https://github.com/denverdino/face_recognition_pi

FROM resin/raspberry-pi-python:3
COPY pip.conf /root/.pip/pip.conf
RUN apt-get -y update
RUN apt-get install -y --fix-missing \
    build-essential \
    cmake \
    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 && pip3 install --upgrade picamera[array] dlib


RUN pip install --upgrade pip
RUN pip install --upgrade pip setuptools wheel


RUN git clone --single-branch https://github.com/ageitgey/face_recognition.git
RUN cd /face_recognition && \
    pip3 install -r requirements.txt && \
    python3 setup.py install

CMD cd /face_recognition/examples && \
    python3 recognize_faces_in_pictures.py

如果有人知道现在该做什么,我们会很高兴。 谢谢!

构建前必须安装 Pybind11 SciPy:

python3 -m pip install pybind11