【发布时间】:2020-02-11 18:02:57
【问题描述】:
我在我的 Windows 上安装了 Git-Bash 和 conda,它提供了两个程序:C:\Program Files\Git\git-bash.exe 和 C:\\Program Files\\Git\\bin\\bash.exe。
后者 C:\\Program Files\\Git\\bin\\bash.exe 不能与 conda 一起正常工作。当我尝试conda acitvate base 时,我收到一条消息:
Administrator@##### MINGW64 /bin
$ conda --version
conda 4.7.12
Administrator@##### MINGW64 /bin
$ conda activate base
CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
If using 'conda activate' from a batch script, change your
invocation to 'CALL conda.bat activate'.
To initialize your shell, run
$ conda init <SHELL_NAME>
Currently supported shells are:
- bash
- cmd.exe
- fish
- tcsh
- xonsh
- zsh
- powershell
See 'conda init --help' for more information and options.
IMPORTANT: You may need to close and restart your shell after running 'conda init'.
我尝试了conda init 和conda init bash,然后关闭并重新打开bash.exe,但还是一样。
知道如何解决这个问题吗?
可能的解决方法:
我担心这个问题,因为 VSCode 的集成终端使用它。我尝试使用 C:\Program Files\Git\git-bash.exe 作为集成终端,但它会打开一个新窗口,而不是 VSCode 中的“集成”。
git-base.exe 与 conda 配合得很好,因此有关如何将 git-base.exe 设置为 VSCode 集成终端的指南也是可以接受的。
任何帮助将不胜感激。
【问题讨论】:
-
谢谢@Simba。但实际上我的路径中有
conda。我打电话给conda --version,bash 成功显示了 conda 的信息。 -
我遇到了同样的问题。我将我的
.bash_profile重命名为.bashrc并且它起作用了 -
@Auss 这对我有用,你能解释一下为什么吗?
-
@Auss 除非您知道这些文件已经包含什么,否则最好将 .bash_profile 复制到 .bashrc 而不是重命名它。这些是来自不同场合的文件,将来可能会导致交互式登录或类似问题出现问题