Building wheel for scipy (setup.py): finished with status 'error'

Viewed 5764

I am trying to build a Docker Image and install these requirements with a requirements.txt-file:

numpy==1.18.1
scipy==1.2.1
joblib==0.13.2
Cython==0.29.13
pandas==0.25.3
scikit-learn==0.21.3
h5py==2.8.0
Keras==2.3.1
Keras-Applications==1.0.8
Keras-Preprocessing==1.1.0

This is my dockerfile:

FROM python:3

MAINTAINER author@sample.com

RUN mkdir /test
COPY ./ /test
WORKDIR /test

## Install your dependencies here using apt-get etc.


RUN pip install -r requirements.txt

When I try to build theThis is the error message I get

ERROR: Command errored out with exit status 1:
   command: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-d0v5nn_0/scipy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-d0v5nn_0/scipy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-u8mo7l4r
       cwd: /tmp/pip-install-d0v5nn_0/scipy/
  Complete output (9 lines):
  /tmp/pip-install-d0v5nn_0/scipy/setup.py:114: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
    import imp
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-install-d0v5nn_0/scipy/setup.py", line 492, in <module>
      setup_package()
    File "/tmp/pip-install-d0v5nn_0/scipy/setup.py", line 468, in setup_package
      from numpy.distutils.core import setup
  ModuleNotFoundError: No module named 'numpy'
  ----------------------------------------
  ERROR: Failed building wheel for scipy

After this it also tries to run a

Running setup.py clean for scipy

but without success

1 Answers

Not sure if it's the reason for the error but considering the release notes of Numpy 1.18.1, you should have Cython ≥ 0.29.14 whereas the requirements.txt specifies Cython==0.29.13.

FROM python:3 results in getting Python 3.8.

The Python versions supported in this release are 3.5-3.8. Downstream developers should use Cython >= 0.29.14 for Python 3.8 support and OpenBLAS >= 3.7 to avoid errors on the Skylake architecture.

Related