Docker:scipy 构建轮子失败

标签 docker scipy 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

这是 docker 文件:
#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

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

最佳答案

在构建 SciPy 之前,您必须安装 Pybind11:

python3 -m pip install pybind11

关于Docker:scipy 构建轮子失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60731057/

相关文章:

python - 一个人可以在 scikit-learn 管道中同时训练估计器吗?

python - Scipy 稀疏三角矩阵?

c++ - 无法打印更多的 pi 小数

c - 我们如何确定这段代码中开头的 'b' 的值是 0

wordpress - 如何将 nginx 反向代理修复为用户的 WordPress docker 重定向端口?

docker - Docker cp需要两个参数

python - 使用 sci-kit 中的训练/测试数据而不是交叉验证来学习曲线

c# - 如何在 docker 容器内运行此 PowerShell 脚本?

docker - Nginx 容器 : no "ssl_certificate_key" is defined for certificate

java - 如何逼近圆周率