【发布时间】:2019-02-03 12:13:50
【问题描述】:
我在 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_profile 的内容
[[ -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 <<<
【问题讨论】:
-
请显示您运行的生成此错误的确切命令。谢谢!
-
我不确定是什么命令造成了这个问题,但我在终端历史记录中搜索,发现一些我怀疑的:`
export PATH=~/anaconda3/bin:$PATHexport PATH="$PATH:$HOME/bin”printf %q "$PATH” -
不,当您在帖子中看到该错误消息时,您会运行什么命令?
-
我现在不记得了,但是每次我打开时终端都会显示此消息:上次登录:2 月 4 日星期一 18:57:58 on ttys001 /Users/rodalbert/.bash_profile:export:3: not标识符:2018.12 ➜ ~ `
-
请将您的
.bash_profile的全部内容发布
标签: bash terminal anaconda command-line-interface conda