Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save sr75/1c0b602b6f551939f0b1 to your computer and use it in GitHub Desktop.
Save sr75/1c0b602b6f551939f0b1 to your computer and use it in GitHub Desktop.
remove python 2.7 on mac osx if installed via python.org installer .dmg
# sudo rm -rf /Library/Frameworks/Python.framework
sudo rm -rf /Library/Frameworks/Python.framework/Versions/2.7
sudo rm -rf "/Applications/Python 2.7"
cd /usr/local/bin && \
sudo ls -l /usr/local/bin | grep '../Library/Frameworks/Python.framework/Versions/2.7' | awk '{print $9}' | xargs rm
@wizardbyron
Copy link

Thanks man, it helps.

@AskFeeds
Copy link

AskFeeds commented May 9, 2019

Thanks for this Ninja trick. Just got it done.

It seems Python.org has added uninstall directions to the documentation:
http://docs.python.org/3/using/mac.html

I also found it's better to remove the following python leftover files, such as:
~Library/Frameworks/Python.framework
~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/org.python.idle.sfl
~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/org.python.pythonlauncher.sfl
Some helpful tips here: Uninstall Python Mac

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