CommandNotFoundError: Your shell has not been properly configured to use ‘conda activate‘.

Posted xiejunna

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CommandNotFoundError: Your shell has not been properly configured to use ‘conda activate‘.相关的知识,希望对你有一定的参考价值。

安装完conda后,切换虚拟环境,异常CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
查看虚拟环境时,确定有刚创建好的虚拟环境,如下

conda env list
# conda environments:
#
base                  *  /home/dev/anaconda3
py38                     /home/dev/anaconda3/envs/py38

切换虚拟环境异常,如下conda activate py38

conda activate py38

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'.

解决:先初始化source activate再切换虚拟环境,成功

 source activate
(base) [dev@ymt-0019 ~]$ 
(base) [dev@ymt-0019 ~]$ conda env list
# conda environments:
#
base                  *  /home/dev/anaconda3
py38                     /home/dev/anaconda3/envs/py38

(base) [dev@ymt-0019 ~]$ 
(base) [dev@ymt-0019 ~]$ 
(base) [dev@ymt-0019 ~]$ conda activate py38
(py38) [dev@ymt-0019 ~]$ 
(py38) [dev@ymt-0019 ~]$ conda env list       
# conda environments:
#
base                     /home/dev/anaconda3
py38                  *  /home/dev/anaconda3/envs/py38

以上是关于CommandNotFoundError: Your shell has not been properly configured to use ‘conda activate‘.的主要内容,如果未能解决你的问题,请参考以下文章

CommandNotFoundError: Your shell has not been properly configured to use ‘conda activate‘.

CommandNotFoundError: Your shell has not been properly configured to use ‘conda activate‘.

VsCode问题:CommandNotFoundError: Your shell has not been properly configured to use ‘conda activate‘.C

CommandNotFoundError: Your shell has not been properly configured to use ‘conda activate‘

完美解决CommandNotFoundError: Your shell has not been properly configured to use ‘conda activate‘.

Anaconda使用conda activate激活环境出错:CommandNotFoundError: Your shell has not been properly configured to