vscode 在使用powershell激活python环境时会出现以下报错:
@[TOC](这里写自定义目录标题)
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'.
解决办法:
使用cmd.exe来初始化环境,而非power shell
具体方法:powershell中接着输入以下命令
conda init cmd.exe
之后会更新环境变量之类的东西,结束后关掉重启即可
22/04/22更新
在对其他电脑安装环境时发现该报错似乎不影响vscode的功能