ubuntu 打开终端自动激活指定的虚拟环境

修改~/.zshrc 或者~/.bashrc中的conda配置

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


最后一行配置conda activate env_name

你可能感兴趣的:(ubuntu 打开终端自动激活指定的虚拟环境)