IT|作業系統|Mac|Mac OS 上 的 Python 3 路徑問題&安裝方法
Mac OS 作業系統 中,預設的 P ython 版本是 2.7,因為開發需要,所以安裝 Pyhon3 安裝 Xcode 命令行工具 xcode-select--install 安裝 Mac OS 的套件管理工具 Homebrew ruby -e "$(curl --insecure -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install )" 如果失敗了,執行卸載操作,輸入如下命令進行卸載: ---------------- ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall )" 安裝 Python brew install python3 Python3 預設會被 安裝到這裡 /usr/local/Cellar/python —> 安裝路徑 /usr/local/bin/python3。 —> 執行環境路徑 系統 Python2 在這裡 --------------------------- /usr/bin/python 監測是否安裝成功 which python3 備注 1.安裝過程中我安裝 Python3 失敗,後來是重新執行 Homebrew 安裝才成功。 ruby -e "$(curl --insecure -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install ) 2.H omebrew 若 安裝失敗,建議將其卸載再重新安裝。 3. brew python3 若安裝 失敗, 解決方式:先 執行 , xcode-select–install ,然後執行 Python3 安裝。 xcod...