python - VS Code 继续选择 PowerShell 来运行 Python 脚本
问题描述
我使用 Anaconda 作为 Python Distribution 并且 VS Code 很好地识别了它。我可以轻松更改 Python 解释器。我还将终端默认配置文件设置为Command Prompt
. 当我使用快捷方式打开终端时Ctrl+`
,终端使用成功打开Command Prompt
,甚至激活了 conda 环境。当我单击时出现问题Run Python File in Terminal
。Command 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
。
解决方案
推荐阅读
- java - 如何使用 SEDA(分阶段事件驱动架构)编写简单的 HTTP Echo 服务?
- r - 按前一个日期 + 7 天替换 NA
- scala - 需要从 Option Vector 中获取列表
- css - 如何从 Google-fonts 的网络字体中获得真正的小型大写字母
- python - 如何使用嵌套的 for 循环重写这个 while 循环?
- node.js - 如何将邮递员中的 include_type_name 设置为 true
- ios - 我们能否检测到用户是否在后台关闭了互联网?
- java - 为什么我无法在 java 中读取大数据文件?
- postgresql - 为什么sql文件的格式会影响它们是否可以在PG中运行?
- javascript - 如何修复未链接到用于排序数据的功能的按钮?(只有javascript,没有jquery)