macbook 添加修改编辑 用户环境变量

以anaconda为例

1.打开终端,输入 :

vim ~/.bash_profile

打开bash_profile文件检查环境变量。

2.如果环境中没有conda需要手动添加,方法是:

英文输入法下点击i,进入vim的insert模式,输入,

export PATH="anaconda的路径/bin:$PATH"

然后点击Esc退出insert模式,然后shift+:,输入wq 回车,保存退出vim。

3.终端里刷新环境变量:

source ~/.bash_profile
原文地址:https://www.cnblogs.com/Tang-tangt/p/14006898.html