Mac下python2升級3

1.下載python最新版本 python

 🔗連接:https://www.python.org/downloads/mac-osx/swift

安裝默認位置爲: /Library/Frameworks/Python.framework/Versions/3.5/  bash

2.打開終端,修改~/.bash_profile文件spa

代碼以下:
# Setting PATH for Python 3.6
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.6/bin:${PATH}"
export PATH

alias python="/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6"

 

3.重啓終端或執行blog

source ~/.bash_profile
相關文章
相關標籤/搜索