相关疑难解决方法(0)

在 gitlab CI 期间激活 conda 环境

我的.gitlab-ci.yml文件看起来像这样:

anomalydetector:
  image: continuumio/miniconda:4.7.10
  stage: build
  tags:
    - docker
  script:
    - conda env create -f environment.yml
    - conda activate my-env
    - pytest tests/.
Run Code Online (Sandbox Code Playgroud)

在 Gitlab 上,这项工作开始正常,并且日志读取

$ conda env create -f environment.yml
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done


==> WARNING: A newer version of conda exists. <==
  current version: 4.7.10
  latest version: 4.7.11
Run Code Online (Sandbox Code Playgroud)

好的,所以我使用的是conda4.4 之后的版本,所以conda activate应该可以工作。但是,作业失败并显示以下内容:

# To activate this environment, use
#
#     $ conda activate my-env
#
# …
Run Code Online (Sandbox Code Playgroud)

python continuous-integration gitlab anaconda conda

11
推荐指数
2
解决办法
3046
查看次数

标签 统计

anaconda ×1

conda ×1

continuous-integration ×1

gitlab ×1

python ×1