Skip to content

Instantly share code, notes, and snippets.

@munhitsu
Created June 19, 2011 21:11
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save munhitsu/1034761 to your computer and use it in GitHub Desktop.
Save munhitsu/1034761 to your computer and use it in GitHub Desktop.
python 2.7 (*.dmg) uninstall from OSX
sudo rm -rf /Library/Frameworks/Python.framework/Versions/2.7
sudo rm -rf "/Applications/Python 2.7"
ls -l /usr/local/bin | grep '../Library/Frameworks/Python.framework/Versions/2.7' | cut -d " " -f 18 | xargs -IM sudo rm /usr/local/bin/M
echo based on http://stackoverflow.com/questions/3819449/how-to-uninstall-python-2-7-on-a-mac-os-x-10-6-4
@siaw23-retired
Copy link

this doesn't work :)

@bbezanson
Copy link

Back at the link listed above is this line that works better -- the cut assumes a certain amount of spaces -- which varies and caused the issue you saw. This line works:

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

@maryampashmi
Copy link

hey, I am getting following errors:
mbp-de-user:bin maryam$ ls -l . | grep '../Library/Frameworks/Python.framework/Versions/2.7' | awk '{print $9}' | xargs rm
rm: 2to3-2.7: Permission denied
rm: idle2.7: Permission denied
rm: pydoc2.7: Permission denied
rm: python2.7: Permission denied
rm: python2.7-config: Permission denied
rm: pythonw2.7: Permission denied
rm: smtpd2.7.py: Permission denied
rm: trial: Permission denied
rm: twistd: Permission denied

@hungtran0306
Copy link

You need to sudo

@saamehg
Copy link

saamehg commented Feb 17, 2017

Even with sudo I am receiving the same message: permission denied!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment