文章目录
- [1 原因](#1 原因)
- [2 解决](#2 解决)
- 参考
1 原因
一般在bash中不会出现这样的问题,运行conda init之后即可完成。但是当前系统配置了zsh,在 zshrc 中没有相关的 conda 配置
2 解决
使用conda 初始化 zsh
shell
conda inti zsh
此时zsh中的内容为:
shell
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/hanliqiang/miniconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/home/hanliqiang/miniconda3/etc/profile.d/conda.sh" ]; then
. "/home/hanliqiang/miniconda3/etc/profile.d/conda.sh"
else
export PATH="/home/hanliqiang/miniconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
生效配置文件(这里一定要生效配置文件)
shell
source ~/.zshrc