我正在尝试使用这个Dockerfile安装seaborn
:
FROM alpine:latest
RUN apk add --update python py-pip python-dev
RUN pip install seaborn
CMD python
我遇到的错误与 numpy
和 scipy
(由seaborn
所需)有关。 它以以下内容开头:
/tmp/easy_install-nvj61E/numpy-1.11.1/setup.py:327: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
以以下内容结尾:
File "numpy/core/setup.py", line 654, in get_mathlib_info
RuntimeError: Broken toolchain: cannot link a simple C program
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-DZ4cXr/scipy/
The command '/bin/sh -c pip install seaborn' returned a non-zero code: 1
你有任何想法如何解决这个问题吗?
lapack-dev
(使用python:alpine
docker 镜像别名代替python:3.6-alpine
),因此我需要使用 http://dl-4.alpinelinux.org/alpine/latest-stable/community 来获取lapack-dev
包。 - Shadinumpy
被更新了,编译失败了。如此处所述,您可以执行pip install numpy==1.14.3
,但是请注意,如果您开始安装pandas
,它将再次尝试带来最新版本的numpy
。 - Bulat