问题描述
- 在 Ubuntu 下使用 conda 激活虚拟环境时报错:
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'.
解决方法
- 首次使用 conda 虚拟环境时,先使用 source 代替 conda 打头激活虚拟环境
source activate 虚拟环境名称
在Ubuntu操作系统中,遇到使用conda激活虚拟环境时出现CommandNotFoundError的问题。错误提示表明shell未正确配置以使用'conda activate'。为解决此问题,首次激活应使用'source activate'代替'conda activate'命令,并根据提示可能需要运行'condainit'初始化shell。关闭并重启shell后,错误通常可以得到解决。
1万+

被折叠的 条评论
为什么被折叠?



