vscode启动时终端显示:
CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
To initialize your shell, run
$ conda init
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'.
我的linux系统上安装了anaconda, 根据上述提示,执行: conda init bash。
重启vscode,发现依旧提示该问题。
突然想到,.bashrc中配置过conda activate dl类似的配置conda默认启动环境的,是不是.bashrc有问题呢。
执行source .bashrc
, 提示python路径不存在,修改环境变量为正确的路径后,重新source .bashrc
, 重启vscode, 不再提示该问题。问题解决。