1.打开visual studio,点击File->Preferences→Settings,找到Features下面的Terminal,点Edit in settings.json
2.找到 Anaconda Prompt文件所在位置,鼠标右键查看属性,将目标中的值复制出来
我的是%windir%\System32\cmd.exe "/K" E:\Miniconda2\Scripts\activate.bat E:\Miniconda2
将"/K"和 E:\Miniconda2\Scripts\activate.bat E:\Miniconda2复制到terminal.integrated.shellArgs.windows
3.将示例中对应的值修改好之后赋值到settings.json
示例如下:
{ "python.pythonPath": "E:\\Miniconda2\\envs\\python36_test\\python.exe", //选择默认使用的Python环境,可以不写 "terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe", "terminal.integrated.shellArgs.windows": [ "/K", "E:\\Miniconda2\\Scripts\\activate.bat E:\\Miniconda2" ] }