为什么我的 shell 现在有“(base)”,如“(base) user@laptop”?

为什么我的 shell 现在有“(base)”,如“(base) user@laptop”?

我的 shell 模拟器(Kubuntu 上的 konsole)以及虚拟终端(Alt+F2 等)现在都在通常的“user@laptop”前面显示“(base)”。

我认为最近的一些更新或软件包安装导致了这种情况。

这很烦人。它从哪里来?我该如何再次摆脱它?

编辑:所以它是conda来自以下几行.bashrc

# >>> conda initialize >>>
!! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/username/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/home/username/anaconda3/etc/profile.d/conda.sh" ]; then
        . "/home/username/anaconda3/etc/profile.d/conda.sh"
    else
        export PATH="/home/username/anaconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda initialize <<<

答案1

这可能意味着您正在使用 anaconda 基础环境。 Anaconda 通过将某些库和可执行文件添加到相应的路径来稍微改变您的环境。特别是,如果选择 anaconda 版本的 python 和相关工具。

您可以安装和激活/停用其他 anaconda 环境,提示符也会相应变化。

它通常不会干扰系统的其余部分,但某些程序可能会受到影响。

我承认可能有更多原因在您的提示中包含“(base)”,只是 anaconda 似乎是最常见的。

相关内容