- VS Code安装官方Python插件
- 使用VS Code打开工作目录
ctrl+shift+P
打开命令,选择Python: Select Interpreter
,选择要打开的Anaconda环境
如果报错CommandNotFoundError: Your shell has not been properly configured to use ‘conda activate‘.
可以尝试以下步骤
- 将conda添加到环境变量
- 输入
conda init powershell
- 在Anaconda Prompt中退出base环境