CommandNotFoundError: Your shell has not been properly configured to use ‘conda activate‘
Posted Xavier Jiezou
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CommandNotFoundError: Your shell has not been properly configured to use ‘conda activate‘相关的知识,希望对你有一定的参考价值。
问题描述
用 conda 创建了一个新环境,无法激活,报错信息如下。
$ conda activate env_name
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'.
原因分析
脚本执行策略受限。
解决方案
以管理身份运行 Windows 终端,执行 set-ExecutionPolicy RemoteSigned
命令,然后输入 Y
(是)。
PS C:\\Windows\\system32> set-ExecutionPolicy RemoteSigned
执行策略更改
执行策略可帮助你防止执行不信任的脚本。更改执行策略可能会产生安全风险,如 https:/go.microsoft.com/fwlink/?LinkID=135170
中的 about_Execution_Policies 帮助主题所述。是否要更改执行策略?
[Y] 是(Y) [A] 全是(A) [N] 否(N) [L] 全否(L) [S] 暂停(S) [?] 帮助 (默认值为“N”): Y
引用参考
以上是关于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