【发布时间】:2021-12-21 19:36:18
【问题描述】:
我以前可以基于以下构建docker镜像
Dockerfile
FROM python:3.7
COPY ./* ./app/
WORKDIR /app/
RUN pip install -r requirements.txt
EXPOSE 80
CMD ["python", "application.py"]
requirements.txt
Flask==1.1.1
Werkzeug==1.0.1
Flask-Cors==3.0.8
pandas==0.25.0
但由于某种原因,现在出现以下错误:
Exception: Cython-generated file 'pandas/_libs/algos.c' not found.
Cython is required to compile pandas from a development branch.
Please Cython or download a release package of pandas.
ERROR: Command errored out with exit status 1: /usr/local/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-sj5w0hrl/pandas_95358ad691f84ba592a47a0ee2865610/setup.py'"'"'; __file__='"'"'/tmp/pip-install-sj5w0hrl/pandas_95358ad691f84ba592a47a0ee2865610/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-gq03hxk9/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.7m/pandas Check the logs for full command output.
#8 29.80 WARNING: You are using pip version 21.2.4; however, version 21.3.1 is available.
#8 29.80 You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
也观察到了
Building wheel for pandas (setup.py): started 在此过程的早期。
我能够在 anaconda python 3.7 环境中运行 application.py,使用完全相同的库版本,但不确定为什么无法构建 Docker 映像。
任何指针将不胜感激!
【问题讨论】:
-
那些部门都超级老——尝试使用更现代的版本
标签: python pandas docker pip containers