Mac修改默认Python版本

1.安装Python 3

2.查看Python3 安装路径

打开终端,输入which python3,查看路径:
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3

3.打开配置文件

open ~/.bash_profile

4.写入外部环境变量

export PATH=${PATH}://Library/Frameworks/Python.framework/Versions/3.6/bin/python3

5.重命名Python

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

6.关闭文件

7.终端执行命令:

source ~/.bash_profile

8.终端执行命令: python

检查Python版本

你可能感兴趣的:(Mac修改默认Python版本)