转载:https://blog.csdn.net/lgt3402788288/article/details/105265764

当我们使用vscode的终端操作时,一般默认选择是cmd.exe,或者是powershell.exe,这两个选择下我们在终端使用activate 命令激活自己的虚拟环境是不可以的,因为存在冲突,解决办法则需修改vscode配置文件。
首先文件->首选项->设置 ,在右上角点打开json按钮
在后面加上这个配置就行

1
2
3
4
5
6
7
8
9

"terminal.integrated.profiles.windows": {
"my-cmd": {
"path": "C:\\Windows\\System32\\cmd.exe",
"args": []
}
},
"terminal.integrated.defaultProfile.windows": "my-cmd"