我刚安装了蟒蛇。当我尝试运行一个命令时,比如conda --version
,我得到了以下错误消息:
zsh: command not found: conda
当我输入的时候:
source ~/.bash_profile
一切正常:
conda --version
conda 4.8.0
但每次启动终端时,我都必须键入命令。
我的.bash_profile看起来像这样:
# added by Anaconda3 2019.10 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/Users/myusername/opt/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
\eval "$__conda_setup"
else
if [ -f "/Users/myusername/opt/anaconda3/etc/profile.d/conda.sh" ]; then
. "/Users/myusername/opt/anaconda3/etc/profile.d/conda.sh"
CONDA_CHANGEPS1=false conda activate base
else
\export PATH="/Users/myusername/opt/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda init <<<
我能做些什么来解决这个问题呢?
系统: macOS
发布于 2019-12-17 19:43:43
将source ~/.bash_profile
放入~/.zsh
中
Bash在初始化期间加载.bash_profile,对于zsh,它是.zsh
使用macOS Catalina将默认shell从bash更改为zsh,这就是出现问题的原因。
https://stackoverflow.com/questions/59380973
复制相似问题