我正在尝试构建一个Docker映像并使用requirements.txt文件安装这些要求:
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
这是我的dockerfile:
FROM python:3
MAINTAINER [email protected]
RUN mkdir /test
COPY ./ /test
WORKDIR /test
## Install your dependencies here using apt-get etc.
RUN pip install -r requirements.txt
当我尝试构建theThis是错误消息
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
在此之后,它还会尝试运行
Running setup.py clean for scipy
但没有成功
不知道这是否是错误的原因,但考虑Numpy 1.18.1的发行说明,您应该使Cython≥0.29.14而requirements.txt
指定了Cython==0.29.13
。
FROM python:3
结果得到Python 3.8。
此版本中支持的Python版本为3.5-3.8。下游开发人员应使用Cython> = 0.29.14获得Python 3.8支持,并使用OpenBLAS> = 3.7,以避免Skylake体系结构上的错误。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句