【发布时间】:2022-01-06 18:05:01
【问题描述】:
所以,我有一个 docker 文件,其中的说明之一是:
RUN pip3 install -r requirements.txt
在我的requirements.txt:
...
uwsgi==2.0.19.1
cython==0.29
dependency-injector==4.37.0
pyyaml==6.0
apscheduler==3.7.0
pyarrow==5.0.0
...
当我运行 docker build 时,我看到 Cython 已安装,但 pyarrow 仍然失败。我找到了这个链接 - https://github.com/apache/arrow/issues/2163 - 它提到 cmake & cython 是必需的,我在我的 requirements.txt 中添加了它,但它仍然没有帮助。我是否必须在我的Dockerfile 中添加其他语句才能安装cython?
Dockerfile 构建的输出:
Collecting cython==0.29 (from -r requirements.txt (line 8))
Downloading https://files.pythonhosted.org/packages/64/3f/cac281f3f019b825bbc03fa8cb7eb03d9c355f4aa9eef978279a4966cb21/Cython-0.29-cp36-cp36m-manylinux1_x86_64.whl (2.1MB)
...
Collecting pyarrow==5.0.0 (from -r requirements.txt (line 12))
Downloading https://files.pythonhosted.org/packages/68/7c/0e38bfb949ededdd9b648d54cba47972835704543d7409d6f853504d0581/pyarrow-5.0.0.tar.gz (739kB)
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-395casa1/pyarrow/setup.py", line 39, in <module>
from Cython.Distutils import build_ext as _build_ext
ModuleNotFoundError: No module named 'Cython'
Python 3.6 安装在这个基础镜像上
【问题讨论】:
-
在安装pyarrow之前尝试单独安装cython
-
是的,我做到了,但它失败了 - pip3 升级创造了奇迹!
标签: python-3.x docker pip cython pyarrow