久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

在 gitlab CI 期間激活 conda 環(huán)境

Activating conda environment during gitlab CI(在 gitlab CI 期間激活 conda 環(huán)境)
本文介紹了在 gitlab CI 期間激活 conda 環(huán)境的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我的 .gitlab-ci.yml 文件如下所示:

My .gitlab-ci.yml file looks like this:

anomalydetector:
  image: continuumio/miniconda:4.7.10
  stage: build
  tags:
    - docker
  script:
    - conda env create -f environment.yml
    - conda activate my-env
    - pytest tests/.

在 Gitlab 上,這項(xiàng)工作開始正常,并且讀取了日志

On Gitlab, this job starts fine, and the logs read

$ 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

好的,所以我使用的是 4.4 之后的 conda 版本,所以 conda activate 應(yīng)該可以工作.但是,作業(yè)失敗并顯示以下內(nèi)容:

Ok, so I'm using a conda version later than 4.4, so conda activate should work. However, the job fails with the following:

# To activate this environment, use
#
#     $ conda activate my-env
#
# To deactivate an active environment, use
#
#     $ conda deactivate

$ conda activate my-env

CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
To initialize your shell, run

    $ conda init <SHELL_NAME>

然后我嘗試編輯我的 .gitlab-ci.yml 文件以便有一個(gè)命令

I have then tried editing my .gitlab-ci.yml file so that there is a command

conda init bash

然后得到消息

==> For changes to take effect, close and re-open your current shell. <==

如何在 gitlab CI 進(jìn)程中激活我的 conda 環(huán)境?

How can I activate my conda environment in the gitlab CI process?

推薦答案

conda init 觸及 .bashrc 文件.要重新初始化 shell,您可以獲取它:

conda init touches the .bashrc file. To reinitialize the shell you can source it:

  - conda create --name myenv
  - conda init bash
  - source ~/.bashrc    # <- !!!
  - conda activate myenv 

我猜這是否比 source activate myenv 更好或更差是一個(gè)單獨(dú)的討論.

Whether this is better or worse than source activate myenv is a separate discussion, I guess.

這篇關(guān)于在 gitlab CI 期間激活 conda 環(huán)境的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

How to draw a rectangle around a region of interest in python(如何在python中的感興趣區(qū)域周圍繪制一個(gè)矩形)
How can I detect and track people using OpenCV?(如何使用 OpenCV 檢測和跟蹤人員?)
How to apply threshold within multiple rectangular bounding boxes in an image?(如何在圖像的多個(gè)矩形邊界框中應(yīng)用閾值?)
How can I download a specific part of Coco Dataset?(如何下載 Coco Dataset 的特定部分?)
Detect image orientation angle based on text direction(根據(jù)文本方向檢測圖像方向角度)
Detect centre and angle of rectangles in an image using Opencv(使用 Opencv 檢測圖像中矩形的中心和角度)
主站蜘蛛池模板: 亚洲在线 | 日本xx视频免费观看 | 黄色视频a级毛片 | 久久大陆 | 免费av在线网站 | 亚洲精品国产成人 | 亚洲精品中文在线观看 | 五月天国产视频 | 在线欧美亚洲 | av免费网址 | 欧美精品在线一区二区三区 | 在线国产视频 | 精品久久久久久久人人人人传媒 | 全免费a级毛片免费看视频免 | 欧美成人a∨高清免费观看 色999日韩 | 一区二区三区亚洲 | 国产农村一级国产农村 | www.99热.com | 人人射人人草 | 午夜视频在线观看一区二区 | 自拍视频网站 | 羞羞涩涩在线观看 | 免费欧美| 国产成人精品一区二区在线 | 日韩国产在线 | 成人h动漫亚洲一区二区 | 日韩不卡一二区 | 91精品国产一区二区三区蜜臀 | 国产 欧美 日韩 一区 | 国产精品一区二区三区在线 | 在线播放日韩 | 欧美小视频在线观看 | 久久一区二区三区四区 | 国产二区三区 | 国精产品一品二品国精在线观看 | 国产一区二区电影网 | 亚洲精品久久久一区二区三区 | 欧美一级黄色片在线观看 | 亚洲女人天堂网 | 国产色婷婷久久99精品91 | 蜜桃五月天 |