首页 > 解决方案 > VS Code 继续选择 PowerShell 来运行 Python 脚本

问题描述

我使用 Anaconda 作为 Python Distribution 并且 VS Code 很好地识别了它。我可以轻松更改 Python 解释器。我还将终端默认配置文件设置为Command Prompt. 当我使用快捷方式打开终端时Ctrl+`,终端使用成功打开Command Prompt,甚至激活了 conda 环境。当我单击时出现问题Run Python File in TerminalCommand Prompt打开的终端是 ,而不是使用PowerShell。因为conda不在PATH,它会引发这样的异常

conda : The term 'conda' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

为什么会这样?终端默认配置文件已设置为Command Prompt但正在运行的 python 文件保持打开PowerShell

标签: pythonvisual-studio-codevscode-settings

解决方案


推荐阅读