ubuntu sh脚本激活conda 虚拟环境

第一步:初始化coda

命令:sudo gedit ~/.bashrc

第二部:复制其中这样一段代码

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

 

第三部:在结尾处添加

conda activate pyn_env

posted @ 2019-10-03 19:24  比较杂的代码工程师  阅读(2579)  评论(0编辑  收藏  举报