【发布时间】:2022-01-12 20:56:30
【问题描述】:
我在持续集成中运行以下命令(不是在本地机器上):
conda env create -f python/env/foo.yml && conda init bash && conda activate foo
但是,我收到以下错误:
CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
To initialize your shell, run
$ conda init <SHELL_NAME>
Currently supported shells are:
- bash
- fish
- tcsh
- xonsh
- zsh
- powershell
See 'conda init --help' for more information and options.
IMPORTANT: You may need to close and restart your shell after running 'conda init'.
Error: Process completed with exit code 1.
既然是CI,又不能在CI中打开新的shell,那我怎么有同样的效果,才能使用conda activate呢?
【问题讨论】:
-
conda必须配置为使用 CI 工具。您可以调查以查看您的 ENV 的外观并将conda设置为这样。可能您使用的是 Ubuntu 或其他发行版。每个发行版都有自己的约定,您的流程是从 CI 工具的流程中分叉出来的……因此您可以进行逆向工程并使其工作,但需要频道中的更多信息才能提供帮助。 -
我正在使用 github ci。如何为此配置 conda。并且还使用 Ubuntu。还尝试在 conda init bash 之后执行 source ~/.bashrc,但仍然出现相同的错误。
标签: shell continuous-integration conda