1. Open the terminal.
2. Remove the Python 2.7 framework:
sudo rm -rf /Library/Frameworks/Python.framework/Versions/2.7
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.
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.