CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
If using 'conda activate' from a batch script, change your
invocation to 'CALL conda.bat activate'.
To initialize your shell, run
$ conda init <SHELL_NAME>
Currently supported shells are:
- bash
- cmd.exe
- 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的shell环境(本文用的是bash):conda init bash
按理说,重启终端后,默认环境会显示是base
此处参考: conda激活环境:CommandNotFoundError: Your shell has not been properly configured to use ‘conda activate‘
然后再执行激活命令即可,但是重启终端后,我的默认环境并没有显示bash
走弯路1
然后找了另一个办法:
修改环境变量—–>D:\ProgramData\Anaconda3\Scripts (必须删除,不能保留,否则报错)
改成 D:\ProgramData\Anaconda3\condabin
这个是系统变量的PATH,因为安装anaconda时我选择了默认添加到环境变量,所以这个时自动添加的,后续事实证明不能随便改
此处参考: CommandNotFoundError: Your shell has not been properly configured to use ‘conda activate‘解决方法
然而,改完之后更离谱,conda直接识别不了(错误:bash: conda: command not found),一切以conda开头的命令显示bash找不到,看到这里我明白了,上一步的bash已经安装成功了,或者说在我安装前他就可能已经存在了,但为什么他不显示呢?
走弯路2
在bash识别不了conda,时我还参考了这篇文章:conda在shel脚本中提示未初始化
和这篇文章:【解决】bash: conda: command not found
改了/.bashrc文件,并重新执行,然而并没有什么卵用
然后