mac安装python3

1、查看python

brew search python3

2、安装python

brew install python3

可以看到python3的实际安装目录是/usr/local/Cellar/python3/3.6.2

4、打开配置文件并写入python的外部环境变量

open ~/.bash_profile

export PATH=${PATH}:/usr/local/Cellar/python/3.7.3/bin

5、重命名python

alias python="/usr/local/Cellar/python/3.7.3/bin/python3.7"

6、让配置文件生效

source ~/.bash_profile 

7、查看结果

 

posted on 2019-07-10 13:47  葛强强  阅读(229)  评论(0)    收藏  举报