解决shell脚本不能激活conda环境

我想写个bash脚本激活Python3.6环境, 使用tensorboard可视化查看数据

conda activate tf
tensorboard --logdir logs/ --port 10010

傻逼报错:

解决shell脚本不能激活conda环境_第1张图片
conda init bash也不行
找到.bashrc文件, 我若有所思, 粘贴了两段代码

#!/usr/bin/env bash

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

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

conda activate tf

tensorboard --logdir logs/ --port 10010

你可能感兴趣的:(deepin)