Nee*_*eeX 10 git-bash anaconda
我在 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'.
Run Code Online (Sandbox Code Playgroud)
我尝试conda init
了conda init bash
,然后关闭并重新打开bash.exe
,但它仍然保持不变。
关于如何解决这个问题有什么想法吗?
我担心这个问题,因为 VSCode 的集成终端使用它。我尝试使用C:\Program Files\Git\git-bash.exe
集成终端,但它打开一个新窗口,而不是 VSCode 中的“集成”。
它git-base.exe
可以与 conda 配合使用,因此有关如何设置git-base.exe
为 VSCode 集成终端的指南也是可以接受的。
任何帮助,将不胜感激。
对我来说有两个问题:
conda init
创建一个.bash_profile
具有正确初始化的文件,但git-bash.exe
加载.bashrc
(感谢Auss的评论)C:\Users\<username>\.bash_profile
和 bash 都需要~/.bashrc
,但~/
不等于C:\Users\<username>\
。我的解决方案是
code ~/.bashrc
,以确保.bashrc
在正确的位置创建C:\Users\<username>\.bash_profile
并粘贴到打开的.bashrc
小智 5
将.bash_profile中的配置追加到.bashrc文件中
conda init bash
cat ~/.bash_profile >> ~/.bashrc
Run Code Online (Sandbox Code Playgroud)
conda activate $ENVNAME
bash 重新启动后应该可以工作。
归档时间: |
|
查看次数: |
9539 次 |
最近记录: |