标签:mac
第一步,先去python的官网下载最新的python,默认路径安装好。1) 先把系统原来的执行文件删掉
sudo rm /usr/bin/pydoc
sudo rm /usr/bin/python
sudo rm /usr/bin/pythonw
sudo rm /usr/bin/python-config
建立新的链接
sudo ln -s /System/Library/Frameworks/Python.framework/Versions/3.4/bin/pydoc3.4 /usr/bin/pydoc
sudo ln -s /System/Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4 /usr/bin/python
sudo ln -s /System/Library/Frameworks/Python.framework/Versions/3.4/bin/pythonw3.4 /usr/bin/pythonw
sudo ln -s /System/Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4-config /usr/bin/python-config
第六步,更新一下.bash_profile文件
在终端输入vi ~/.bash_profile
按一下i 进入编辑状态
# Setting PATH for Python 3.4
# The orginal version is saved in .bash_profile.pysave
PATH="/System/Library/Frameworks/Python.framework/Versions/3.4/bin:${PATH}"
export PATH
再按一下 "esc" 键 ,结束编辑并输入 ":wq" 存储离开
标签:mac
原文地址:http://blog.csdn.net/chaoyue0071/article/details/42648679