我正试图从Dockerfile
安装scipy
,我不能为我的生活弄清楚如何。无法安装scipy
这里是Dockerfile
:
FROM python:3.5
ENV HOME /root
# Install dependencies
RUN apt-get update
RUN apt-get install -y gcc
RUN apt-get install -y build-essential
RUN apt-get install -y zlib1g-dev
RUN apt-get install -y wget
RUN apt-get install -y unzip
RUN apt-get install -y cmake
RUN apt-get install -y python3-dev
RUN apt-get install -y gfortran
RUN apt-get install -y python-numpy
RUN apt-get install -y python-matplotlib
RUN apt-get install -y ipython
RUN apt-get install -y ipython-notebook
RUN apt-get install -y python-pandas
RUN apt-get install -y python-sympy
RUN apt-get install -y python-nose
# Install Python packages
RUN pip install --upgrade pip
RUN pip install cython
# Install scipy
RUN apt-get install -y python-scipy
这将构建一个图像,但是当我运行的容器,并尝试import scipy
它说:使用RUN pip install scipy
和RUN pip install git+https://github.com/scipy/scipy.git
但这些
Python 3.5.1 (default, Mar 9 2016, 03:30:07)
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import scipy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'scipy'
我曾尝试在完成构建之前抛出一个错误。
说实话,我并不熟悉码头工。什么阻止你在终端上运行'pip install git + https:// github.com/scipy/scipy.git',除了'numpy'依赖? – Mai
你不想要'python3-scipy'吗?看起来你的系统默认使用Python3。 – Suever
或者只是'运行pip安装scipy'?虽然你可能想仔细检查一下你使用的“pip”的确是Python 3.5点。 – Evert