Mac下python2升級3


1.下載python最新版本 

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

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

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

代碼如下:
# 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.重啟終端或執行

source ~/.bash_profile

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM