python 环境变量

打开终端,编辑 bash_profile 文件。第一次配置需要创建配置文件,输入命令 touch .bash_profile 来创建文件,此后输入 open .bash_profile 打开文件并编辑。执行命令:

open ~/.bash_profile

写入:

PATH=”/Library/Frameworks/Python.framework/Versions/3.7/bin:${PATH}”

export PATH

alias python=”/Library/Frameworks/Python.framework/Versions/3.7/bin/python3″

关闭文件(open打开的文件直接点击关闭按钮)

使环境变量生效,在终端输入:

source ~/.bash_profile


sudo xattr -r -d com.apple.quarantine + APP-PATH