我正在尝试编写一个名为myscrpt.sh的脚本,因此当我运行它时,它会自动创建一个虚拟环境并使用conda激活它。我的 conda 版本是 4.7.1。
这是我在myscrpt.sh开头的内容:
#!/bin/bash
conda create --name myenv1
conda activate myenv1
Run Code Online (Sandbox Code Playgroud)
创建环境不是问题,但是我收到错误:
Run Code Online (Sandbox Code Playgroud)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 …