更改终端默认的python 解释器

1. 终端打开.bash_profile文件
open ~/.bash_profile
 
2. 修改.bash_profile文件内容  ,默认应该会有,如果没有PATH路径需要找到本机的路径设置
# Setting PATH for Python 3.5
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.6/bin:${PATH}"
export PATH
 
3. 添加别名
alias python="/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6"

4. 终端中重新读取.bash_profile文件
source .bash_profile


主要就是增加了一句 

alias python="/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6"

你可能感兴趣的:(python)