由于git bash不能使用conda命令,而cmd虽然可以使用conda,却不能使用Linux指令。所以在Windows使用python中经常会出现想要使用两个终端的情况。
-
默认调试终端
点击运行 > 调试默认出现一个终端
-
默认新终端
点击终端 > 新终端默认出现一个终端 -
更改
打开设置,输入shell
Terminal > Integrated > Automation Shell: Windows
在setting.json中编辑
"terminal.integrated.automationShell.windows": "C:\\Windows\\System32\\cmd.exe"
#这一项是默认调试终端,后面改成你的想要的终端路径
"terminal.integrated.shell.windows": "E:\\Git\\Git\\bin\\bash.exe",
#这一项是默认新终端,后面改成你的终端路径
- 注意:如果你的VSCode是conda的环境,最好将默认调试终端改成cmd,如果使用git bash会因为conda activate命令不能使用而报错!