numpy安装中缺lessnumpy.distutils,theano试图使用它
我正在尝试与Theano和烤宽面条build立一个Docker镜像。 这些是主要步骤:
FROM nvidia/cuda:8.0-cudnn5-devel RUN apt-get install -y libopenblas-dev python-dev python-pip RUN pip install --upgrade pip RUN pip install nose numpy scipy pandas h5py scikit-image scikit-learn jupyter RUN pip freeze > requirements.txt && pip install -r requirements.txt --upgrade && rm requirements.txt RUN pip install --upgrade https://github.com/Theano/Theano/archive/master.zip RUN pip install --upgrade https://github.com/Lasagne/Lasagne/archive/master.zip
当图像准备就绪时,我启动它并尝试通过简单地在ipython中导入theano来testingtheano。 我得到以下错误(结束):
/usr/local/lib/python2.7/dist-packages/theano/gof/cmodule.pyc in std_include_dirs() 1579 1580 def std_include_dirs(): -> 1581 numpy_inc_dirs = np.distutils.misc_util.get_numpy_include_dirs() 1582 py_inc = distutils.sysconfig.get_python_inc() 1583 py_plat_spec_inc = distutils.sysconfig.get_python_inc(plat_specific=True) AttributeError: 'module' object has no attribute 'distutils'
根据pip安装的版本是:numpy(1.12.0)和Theano(0.9.0b1)。 我有另一个图像出于某种原因。 numpy.distutils
不存在,但Theano不会尝试在import theano
命令上调用它。
- 为什么不是
numpy
与numpy
安装numpy.distutils
? - 为什么Theano尝试使用它?
- 最重要的是:我该如何解决这个问题?
安装https://github.com/Theano/Theano/archive/master.zip
会为您提供该库的testing版,而且对于每个系统似乎都不能正常工作。
除非你绝对需要Theano 0.9
一些function,否则我build议你从pip自己的仓库安装。 可能对Lasagne
做同样的事情。
RUN pip install theano lasagne