vscode 无法使用 GitBash 激活 conda 虚拟环境

2022/3/20 6:29:59

本文主要是介绍vscode 无法使用 GitBash 激活 conda 虚拟环境,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

Error:

IMPORTANT: You may need to close and restart your shell after running 'conda init'.

解决方案,直接上配置文件:

"terminal.integrated.profiles.windows": {
    "PowerShell": {
      "source": "PowerShell",
      "args": ["-nolog"]
    },
    "GitBash": {
      "path": ["E:\\dev\\envs\\Git\\bin\\bash.exe"],
      "args": ["--login", "-i"]
    }
  },
  "terminal.integrated.defaultProfile.windows": "GitBash",

修改的地方在:GitBash 配置项中的 args 参数中,添加启动参数 --login 这一个即可起作用了!最终效果:
最终效果图

参考链接:https://achuan-2.github.io/posts/be43.html



这篇关于vscode 无法使用 GitBash 激活 conda 虚拟环境的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程