
Ubuntu 20.04.3 LTS
在bash下安装anaconda后,再安装oh-my-zsh 并切换shell 为zsh,
出现
zsh: command not found: conda解决
使用一个editor 比如atom或nano在Terminal中打开 .bashrc
atom ~/.bashrc
找到 conda initialize
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/你的用户名/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/home/你的用户名/anaconda3/etc/profile.d/conda.sh" ]; then
. "/home/你的用户名/anaconda3/etc/profile.d/conda.sh"
else
export PATH="/home/你的用户名/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
注意不同的用户名是不一样的
copy你的.bashrc文件中的这段代码
同样方法打开.zshrc
atom ~/.zshrc
再将上述复制好的代码粘贴到.zshrc文件中
粘贴后可在Terminal中运行
source ~/.zshrc
或者直接重新打开Terminal即可