首先安裝brew
在終端執(zhí)行以下命令即可
git clone git://mirrors.ustc.edu.cn/homebrew-core.git/ /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core --depth=1
使用brew安裝Python
安裝之前可以使用命令檢查以下Python的版本

image.png
然后輸入命令進(jìn)行安裝(以Python3.9為例)
brew install python@3.9

image.png
啟動(dòng)Python3.9
輸入Python的啟動(dòng)命令進(jìn)入即可

image.png