如何不在终端中补编并从终端提示符前面移除(基本)

时间:2019-12-22 19:02:37

标签: bash macos conda

我已经安装了conda,每次打开终端conda都会自动运行,并在终端提示前面放一个(基本)。我正在尝试关闭此conda函数,并需要一些帮助才能完成。以下是我的.bash_profile,请让我知道如何进行修改,并且默认情况下不要在终端机中伪造内容。谢谢。

export PATH="~/go/bin:$PATH"
export PATH="~/.local/bin:$PATH"
# added by Anaconda3 2019.07 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/Users/zwang/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
    \eval "$__conda_setup"
else
    if [ -f "/Users/zwang/anaconda3/etc/profile.d/conda.sh" ]; then
        . "/Users/zwang/anaconda3/etc/profile.d/conda.sh"
        CONDA_CHANGEPS1=false conda activate base
    else
        \export PATH="/Users/zwang/anaconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda init <<<

. ~/.bashrc

1 个答案:

答案 0 :(得分:0)

我从这篇文章中找到了解决方案:https://askubuntu.com/questions/1026383/why-does-base-appear-in-front-of-my-terminal-prompt

This can also be because auto_activate_base is set to True. You can check this using the following command

conda config --show | grep auto_activate_base
To set it false

conda config --set auto_activate_base False
source ~/.bashrc
To reactivate set it to True

conda config --set auto_activate_base True
source ~/.bashrc