升级 Mac 的 Ptyhon 到 3.3 版本

1、下载安装程序:http://python.org/download/,Python 3.3.2 Mac OS X 64-bit/32-bit x86-64/i386 Installer

2、安装

3、以超级用户执行如下脚本:

#!/bin/bash
rm -R /System/Library/Frameworks/Python .framework /Versions/3 .3
mv /Library/Frameworks/Python .framework /Versions/3 .3 /System/Library/Frameworks/Python .framework /Versions
chown -R root:wheel /System/Library/Frameworks/Python .framework /Versions/3 .3
 
rm /System/Library/Frameworks/Python .framework /Versions/Current
ln -s /System/Library/Frameworks/Python .framework /Versions/3 .3 /System/Library/Frameworks/Python .framework /Versions/Current
 
rm /usr/bin/pydoc
rm /usr/bin/python
rm /usr/bin/pythonw
rm /usr/bin/python-config
 
rm /System/Library/Frameworks/Python .framework /Versions/3 .3 /bin/pydoc
rm /System/Library/Frameworks/Python .framework /Versions/3 .3 /bin/python
rm /System/Library/Frameworks/Python .framework /Versions/3 .3 /bin/pythonw
rm /System/Library/Frameworks/Python .framework /Versions/3 .3 /bin/python-config
 
ln -s /System/Library/Frameworks/Python .framework /Versions/3 .3 /bin/pydoc3 /usr/bin/pydoc
ln -s /System/Library/Frameworks/Python .framework /Versions/3 .3 /bin/python3 /usr/bin/python
ln -s /System/Library/Frameworks/Python .framework /Versions/3 .3 /bin/pythonw3 /usr/bin/pythonw
ln -s /System/Library/Frameworks/Python .framework /Versions/3 .3 /bin/python3-config /usr/bin/python-config

4、安装 easy_install:

      ①、curl -O http://python-distribute.org/distribute_setup.py

      ②、sudo python distribute_setup.py

5、建立软链接:sudo ln -s /System/Library/Frameworks/Python.framework/Versions/3.3/bin/easy_install /usr/bin/easy_install

你可能感兴趣的:(mac)