Mac的python版本从2.7升级到 3.8
1、下载python
![](http://upload-images.jianshu.io/upload_images/6793907-1a36c21f371d0d77.png?imageMogr2/auto-orient/strip|imageView2/2/w/1185/format/webp)
image.png
2、安装python 3.8.1
下载好的pkg文件进行安装,安装完成之后,python 3.8.1的默认安装路径如下:执行: open /Library/Frameworks/Python.framework/Versions/3.8
即为安装目录
3、修改profile文件
open ~/.bash_profile
此时会弹出.bash_profile文件,在最后面加入:
alias python=”/usr/bin/python3″ 保存即可
然后重启下配置文件:source ~/.bash_profile
4、验证python版本
python --version
作者:wayne1125
链接:https://www.jianshu.com/p/4f23b11a123b
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。