在 macOS 上安装 anaconda 后,终端 -bash 别名错误

在 macOS 上安装 anaconda 后,终端 -bash 别名错误

我有一台装有 macOS Mojave 10.14.6 (18G95) 的 MacBook Pro,
我在系统上安装了带有 Python 的 Anaconda。
从那时起,每当我打开终端时,我都会收到这些消息

Last login: Sat Oct  5 22:53:55 on console
You have new mail.
-bash: alias: added: not found
-bash: alias: by: not found
-bash: alias: Anaconda3: not found
-bash: alias: 2019.07: not found
-bash: alias: installer: not found
(base) Ayushs-MacBook-Pro:~ Ayush$ 

这是什么意思?它会对我的系统造成任何影响吗?
我该如何删除它?

以下是我的 bash_profile 的内容

# Homebrew
export PATH=/usr/local/bin:$PATH

export PATH=/usr/local/sbin:$PATH

export GOOGLE_APPLICATION_CREDENTIALS=/Users/Ayush/Downloads/ayush-profectus-b02fa250957f.json

# The next line updates PATH for the Google Cloud SDK.
if [ -f '/Users/Ayush/Downloads/google-cloud-sdk/path.bash.inc' ]; then source '/Users/Ayush/Downloads/google-cloud-sdk/path.bash.inc'; fi

# The next line enables shell command completion for gcloud.
if [ -f '/Users/Ayush/Downloads/google-cloud-sdk/completion.bash.inc' ]; then source '/Users/Ayush/Downloads/google-cloud-sdk/completion.bash.inc'; fi

# for complier
export PATH=/usr/local/Cellar/gcc/8.2.0/bin:$PATH
alias gcc='gcc-8'# added by Anaconda3 2019.07 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/Users/Ayush/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
    \eval "$__conda_setup"
else
    if [ -f "/Users/Ayush/anaconda3/etc/profile.d/conda.sh" ]; then
        . "/Users/Ayush/anaconda3/etc/profile.d/conda.sh"
        CONDA_CHANGEPS1=false conda activate base
    else
        \export PATH="/Users/Ayush/anaconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda init <<<

答案1

这行代码就是罪魁祸首:

alias gcc='gcc-8'# added by Anaconda3 2019.07 installer

您可以通过将该行粘贴到新的 shell 中来确认这一点。它会产生完全相同的错误。最有可能的是,它应该在 之前包含一个空格字符#。如下所示:

alias gcc='gcc-8' # added by Anaconda3 2019.07 installer

相关内容