久久久久久久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 檢測圖像中矩形的中心和角度)
主站蜘蛛池模板: 精品视频网 | www.国产91 | 狠狠草视频 | 国产午夜av片 | 免费看黄视频网站 | 久久网一区二区三区 | 六月成人网 | 久久久久久久久99精品 | 中文字幕a√ | 亚洲va欧美va人人爽午夜 | 国产一区二区三区色淫影院 | 国产99久久 | 日韩中文字幕在线视频 | 国产资源在线视频 | 欧美激情欧美激情在线五月 | 日韩精品在线看 | 中文字幕成人av | 免费三级网 | 亚洲欧美日韩精品久久亚洲区 | 奇米久久久 | 日韩精品一区二区三区中文在线 | 99久久久久国产精品免费 | 中文字幕在线免费观看 | 狠狠ri | 久久成人免费视频 | 天天碰日日操 | 亚洲色图综合 | 性色av一区二区三区 | 九九免费视频 | 精品国产乱码久久久久久图片 | 久久久久久久国产 | 成人精品福利 | 三级av在线 | 成人九色| 久久久精 | 成人亚洲网 | 亚洲免费人成在线视频观看 | 成人在线不卡 | 日本特黄特色aaa大片免费 | 国产精品久久久一区二区三区 | 久久新 |