如何更新OSX上bash_profile中的PATH

问题描述 投票:0回答:1

我正在尝试在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 <<<

这是我第一次添加PATH,我尝试查看setting path in terminal但我不确定它如何适用于我的问题。

任何建议将不胜感激。谢谢

bash vim path install
1个回答
0
投票

。bash_profile中的任何地方,添加此行

export PATH=$PATH:/your/new/path/to/add

这只需将/ your / new / path / to /添加到您现有的$ PATH中

© www.soinside.com 2019 - 2024. All rights reserved.