學習自http://www.reibang.com/p/4fd565e3cd31
1嗅辣、下載最新版
- 官網(wǎng)下載python3.8 并且安裝
下載鏈接
2屹耐、打開終端執(zhí)行指令
open ~/.bash_profile
3熬芜、確認.bash_profile文件里是否存在以下內(nèi)容社裆,沒有則添加并保存
注意我的缺少的是 alias python 這一句效览,需要double check
# Setting PATH for Python 3.8
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.8/bin:${PATH}"
export PATH
alias python="/Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8"
4、終端執(zhí)行指令
source ~/.bash_profile
5刹孔、確認升級啡省,終端輸入指令
xxMacBook-Pro:~ xx$ python
Python 3.8.0 (v3.8.0:xxxxxx, Oct 14 2019, 10:23:27)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> xx-Pro:~ xx$ python