您的位置:首页 > 编程语言 > Python开发

How to uninstall Python 2.7 (installed by yourself) on a Mac OS

2016-02-01 10:51 661 查看


How to uninstall Python 2.7 (installed by yourself) on a Mac OS

1. Open the terminal.

2. Remove the Python 2.7 framework:

sudo rm -rf /Library/Frameworks/Python.framework/Versions/2.7

3. Remove the Python 2.7 applications directory:

sudo rm -rf "/Applications/Python 2.7"



4. Remove the symbolic links in /usr/local/bin that point to Python 2.7:


cd /usr/local/bin

ls -l . | grep '../Library/Frameworks/Python.framework/Versions/2.7' | awk '{print $9}' | xargs sudo rm

5. Back to the system default Python:

cd /Library/Frameworks/Python.framework/Versions

sudo rm Current

sudo ln -s /usr/bin/python Current

PS: If you do not carry out Step 5, then there will be an error when you start python in the terminal.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: