2

我有一个conda基于以下 yaml 的虚拟环境:

channels:
  - conda-forge

dependencies:
  - gcc_linux-64
  - gxx_linux-64
  - gfortran_linux-64
  - theano

这是一个简化的例子,实际上 YAML 有更多的包。
详细地说,该软件安装在容器base内的环境docker中,但我不认为我的问题与容器有关。Dockerfile 的重要部分如下:

# BASE IMAGE
FROM ubuntu:18.04

# PATH EXPORT
ENV PATH="/root/miniconda3/bin:${PATH}"
ARG PATH="/root/miniconda3/bin:${PATH}"

# UPDATE THE PACKAGE LIST
RUN apt-get update

# INSTALL WGET
RUN apt-get install -y wget && rm -rf /var/lib/apt/lists/*

# INSTALL MINICONDA WITH PYTHON 3.7
RUN wget --no-verbose \
    https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \
    && mkdir /root/.conda \
    && bash Miniconda3-latest-Linux-x86_64.sh -b \
    && rm -f Miniconda3-latest-Linux-x86_64.sh

# UPDATE CONDA
RUN conda update --name base --channel defaults conda

# COPY THE YAML & INSTALL SOFTWARE WITH CONDA
COPY conda_packages.yaml .
RUN conda env update --name base --file conda_packages.yaml

该容器已正确构建,之后我可以使用命令运行 Anaconda New Compilers:x86_64-conda_cos6-linux-gnu-gccx86_64-conda_cos6-linux-gnu-c++. 但是,当我运行一个测试 python 脚本时,import theano我得到一个错误:

/root/miniconda3/lib/python3.7/site-packages/theano/configdefaults.py:560: UserWarning:

DeprecationWarning: there is no c++ compiler.This is deprecated and with Theano 0.11 a c++ compiler will be mandatory

WARNING (theano.configdefaults): g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string.
WARNING (theano.configdefaults): install mkl with `conda install mkl-service`: No module named 'mkl'
WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions.

当我稍后检查构建日志时,安装的 theano 版本是:1.0.4
编译器版本是:7.3.0

4

0 回答 0