Bash 无法在MacOS终端运行Anaconda

Bash 无法在MacOS终端运行Anaconda,bash,terminal,anaconda,command-line-interface,conda,Bash,Terminal,Anaconda,Command Line Interface,Conda,我在MacOS上安装了Anaconda。我试图在终端中运行conda命令,但收到以下错误消息: ****/Users/rodalbert/.anaconda/navigator/a.tool ; exit; /Users/rodalbert/.bash_profile:export:3: not an identifier: 2018.12 ➜ ~ /Users/rodalbert/.anaconda/navigator/a.tool ; exit; /Users/rodalbert/.ana

我在MacOS上安装了Anaconda。我试图在终端中运行conda命令,但收到以下错误消息:

****/Users/rodalbert/.anaconda/navigator/a.tool ; exit;
/Users/rodalbert/.bash_profile:export:3: not an identifier: 2018.12
➜  ~ /Users/rodalbert/.anaconda/navigator/a.tool ; exit;
/Users/rodalbert/.anaconda/navigator/a.tool: line 1: syntax error near unexpected token `('
/Users/rodalbert/.anaconda/navigator/a.tool: line 1: `bash --init-file <(echo "source activate /Users/rodalbert/anaconda3;")'
[Process completed]****
我找不到问题。有人知道在这种情况下该怎么办吗

.bash_配置文件的内容

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
export PATH=/Applications/Postgres.app/Contents/Versions/11/bin/psql:$PATH# added by Anaconda3 2018.12 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
    \eval "$__conda_setup"
else
    if [ -f "/anaconda3/etc/profile.d/conda.sh" ]; then
        . "/anaconda3/etc/profile.d/conda.sh"
        CONDA_CHANGEPS1=false conda activate base
    else
        \export PATH="/anaconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda init <<<
# added by Anaconda3 2018.12 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/Users/rodalbert/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
    \eval "$__conda_setup"
else
    if [ -f "/Users/rodalbert/anaconda3/etc/profile.d/conda.sh" ]; then
        . "/Users/rodalbert/anaconda3/etc/profile.d/conda.sh"
        CONDA_CHANGEPS1=false conda activate base
    else
        \export PATH="/Users/rodalbert/anaconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda init <<<

看起来你在用Zsh

在Anaconda Navigator中执行任何命令之前,请尝试打开终端应用程序并将shell切换到bash:chsh-s/bin/bash,然后重新启动终端

cd /path/to/anaconda/bin
./conda init zsh
or:
zsh conda init zsh

处理完Anaconda后,切换回Zsh:chsh-s/bin/Zsh,然后重新启动终端。

看起来您正在使用Zsh

cd /path/to/anaconda/bin
./conda init zsh
or:
zsh conda init zsh
在Anaconda Navigator中执行任何命令之前,请尝试打开终端应用程序并将shell切换到bash:chsh-s/bin/bash,然后重新启动终端

cd /path/to/anaconda/bin
./conda init zsh
or:
zsh conda init zsh
使用完Anaconda后,切换回Zsh:chsh-s/bin/Zsh,然后重新启动终端。

我使用了Anaconda的解决方案,然后conda可以在终端上运行

cd /path/to/anaconda/bin
./conda init zsh
or:
zsh conda init zsh
我的案例:cd opt/anaconda3/bin,然后运行:./conda init zsh

我使用的解决方案,然后conda可以在终端上运行

cd /path/to/anaconda/bin
./conda init zsh
or:
zsh conda init zsh

我的案例:cd opt/anaconda3/bin,然后运行:./conda init zsh

请显示生成此错误的确切命令。谢谢我不确定是什么命令造成了这个问题,但我在终端历史记录中搜索,发现了一些我怀疑的命令:`export PATH=~/anaconda3/bin:$PATH export PATH=$PATH:$HOME/bin“printf%q$PATH”不,当你在帖子中看到错误消息时,你会运行什么命令?我现在不记得了,但每次我打开时终端都会显示此消息:上次登录:周一2月4日18:57:58,在ttys001/Users/rodalbert/。bash_profile:export:3:非标识符:2018.12➜ ~ `请发布.bash_配置文件的全部内容。请显示生成此错误的确切命令。谢谢我不确定是什么命令造成了这个问题,但我在终端历史记录中搜索,发现了一些我怀疑的命令:`export PATH=~/anaconda3/bin:$PATH export PATH=$PATH:$HOME/bin“printf%q$PATH”不,当你在帖子中看到错误消息时,你会运行什么命令?我现在不记得了,但每次我打开时终端都会显示此消息:上次登录:周一2月4日18:57:58,在ttys001/Users/rodalbert/。bash_profile:export:3:非标识符:2018.12➜ ~ `请发布你的.bash_个人资料的全部内容