Completely uninstall Python 3 on Mac
How do you completely uninstall Python 3 from a Mac? What steps ensure all associated files, settings, and directories are fully removed from your system?
Uninstalling Python 3 completely from a Mac can be a bit tricky, especially because macOS comes with a system version of Python that you should not touch. So, how do you safely remove a version of Python 3 that you installed manually (like through the official installer or Homebrew)?
- Here's how to completely uninstall Python 3:
- If you installed Python 3 via the official installer from python.org:
- Go to /Library/Frameworks/Python.framework/Versions/ and delete the version folder:
sudo rm -rf /Library/Frameworks/Python.framework/Versions/3.x
Remove symbolic links from /usr/local/bin:
ls -l /usr/local/bin | grep '../Library/Frameworks/Python.framework'
Then manually remove each Python-related link with:
sudo rm /usr/local/bin/python3
sudo rm /usr/local/bin/pip3
(Adjust filenames as needed)
If you used Homebrew to install Python 3:
Run:
brew uninstall python
Additional cleanup:
Delete related caches and configuration files:
rm -rf ~/Library/Caches/pip
rm -rf ~/.local
rm -rf ~/Library/Application Support/pip
A few tips:
- Do not remove /usr/bin/python or any Python 2.x system files—macOS uses them internally.
- Always double-check what you're deleting to avoid breaking other tools.
- By following these steps, you can safely and completely remove your Python 3 installation from macOS without affecting system stability.