我正在尝试在我的 Mac 上安装 Flutter。为此,我需要将路径添加到 .bash_profile
文件中。但是,当我在终端中运行命令 vim .bash_profile
时,会收到以下消息:
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.7/bin:${PATH}"
export PATH
export M2_HOME=/Applications/apache-maven-3.6.3
export PATH=$PATH:$M2_HOME/bin# added by Anaconda3 2019.10 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/Users/sofie-amaliepetersen/opt/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
\eval "$__conda_setup"
else
if [ -f "/Users/sofie-amaliepetersen/opt/anaconda3/etc/profile.d/conda.sh" ]; then
. "/Users/sofie-amaliepetersen/opt/anaconda3/etc/profile.d/conda.sh"
CONDA_CHANGEPS1=false conda activate base
else
\export PATH="/Users/sofie-amaliepetersen/opt/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda init <<<
这是我第一次添加路径,我尝试查看了“在终端中设置路径”的相关问题(setting path in terminal),但不确定如何解决我的问题。
如果有建议,请告诉我,谢谢。
.bash_profile
文件的内容。vim
是一个文本编辑器。你可能想使用open -t .bash_profile
命令,它会在TextEdit中打开该文件(最有可能),这样会更容易处理。你可以在以后学习如何使用vim
(或Emacs,或其他基于终端的编辑器)。 - chepner.bash_profile
只是一系列按顺序由 shell 执行的命令列表。 - chepner