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 $ENVNAMEbash 重新启动后应该可以工作。
| 归档时间: |
|
| 查看次数: |
9539 次 |
| 最近记录: |