第一步:
1、下載brew: /bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
2、執行 source /Users/ddu/.zprofile 或 重啟終端生效
3、brew doctor 檢查是否安裝成功
第二步:
1,查找python3 ,命令:brew search python3
2, 安裝python3,命令:brew install python3 。接下來就是等待。。當輸出表示安裝完成
第三步 Python 默認版本設置:
python3 就是我們剛安裝的新版 python。
which python3 可以查看它的路徑。
然后通過 alias 把默認的 python 指向我們的新路徑。
alias python="/opt/homebrew/bin/python3"
現在只是臨時生效,還要執行 source ~/.bash_profile 才會永久生效