gpt4 book ai didi

python - numpy安装缺少numpy.distutils,theano尝试使用它

转载 作者:行者123 更新时间:2023-12-02 20:16:57 25 4
gpt4 key购买 nike

我正在尝试使用Theano和Lasagne构建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来测试theano。我收到以下错误(已结束):
/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.distutils没有安装numpy
  • Theano为什么尝试使用它?
  • 最重要的是:我该如何解决?
  • 最佳答案

    安装https://github.com/Theano/Theano/archive/master.zip会为您提供该库的Beta版本,但似乎无法在每个系统上正常运行。

    除非您绝对需要Theano 0.9中的某些功能,否则建议您从pip自己的存储库中安装。可能对Lasagne做同样的事情。

    RUN pip install theano lasagne

    关于python - numpy安装缺少numpy.distutils,theano尝试使用它,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42057313/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com