不要试图删除任何苹果公司提供的系统Python中的
/System/Library
和
/usr/bin
,因为这可能会破坏整个操作系统。
注:
下面列出的步骤
python.org installers
.
完整的列表是
documented here
-
删除第三方python2.7框架
sudo rm -rf /Library/Frameworks/Python.framework/Versions/2.7
-
删除python2.7应用程序目录
sudo rm -rf "/Applications/Python 2.7"
-
在中删除符号链接
/usr/local/bin
ls -l /usr/local/bin | grep '../Library/Frameworks/Python.framework/Versions/2.7'
然后运行以下命令删除所有链接:
cd /usr/local/bin/
ls -l /usr/local/bin | grep '../Library/Frameworks/Python.framework/Versions/2.7' | awk '{print $9}' | tr -d @ | xargs rm
-
/Library/Frameworks/Python.framework/Versions/2.7
PATH
~/.bash_login
,
~/.bash_profile
~/.cshrc
~/.profile
,
~/.tcshrc
,和/或
~/.zprofile
.