Config Router

  • Google Sheets
  • CCNA Online training
    • CCNA
  • CISCO Lab Guides
    • CCNA Security Lab Manual With Solutions
    • CCNP Route Lab Manual with Solutions
    • CCNP Switch Lab Manual with Solutions
  • Juniper
  • Linux
  • DevOps Tutorials
  • Python Array
You are here: Home / How to uninstall Python 2.7 on a Mac OS X 10.6.4?

How to uninstall Python 2.7 on a Mac OS X 10.6.4?

August 1, 2021 by James Palmer

Do not attempt to remove any Apple-supplied system Python which are in /System/Library and /usr/bin, as this may break your whole operating system.

NOTE: The steps listed below do not affect the Apple-supplied system Python 2.7; they only remove a third-party Python framework, like those installed by python.org installers.

The complete list is documented here. Basically, all you need to do is the following:

Remove the third-party Python 2.7 framework
sudo rm -rf /Library/Frameworks/Python.framework/Versions/2.7

Remove the Python 2.7 applications directory
sudo rm -rf “/Applications/Python 2.7”

Remove the symbolic links, in /usr/local/bin, that point to this Python version. See them using
ls -l /usr/local/bin | grep ‘../Library/Frameworks/Python.framework/Versions/2.7’

and then run the following command to remove all the links:
cd /usr/local/bin/
ls -l /usr/local/bin | grep ‘../Library/Frameworks/Python.framework/Versions/2.7’ | awk ‘{print $9}’ | tr -d @ | xargs rm

If necessary, edit your shell profile file(s) to remove adding /Library/Frameworks/Python.framework/Versions/2.7 to your PATH environment file. Depending on which shell you use, any of the following files may have been modified:
~/.bash_login, ~/.bash_profile, ~/.cshrc, ~/.profile, ~/.tcshrc, and/or ~/.zprofile.

This one works:
cd /usr/local/bin/
ls -l /usr/local/bin | grep ‘../Library/Frameworks/Python.framework/Versions/2.7’ | awk ‘{print $9}’ | tr -d @ | xargs rm

Description:
It list all the links, removes @ character and then removes them.

Related

Filed Under: Uncategorized

Recent Posts

  • How do I give user access to Jenkins?
  • What is docker volume command?
  • What is the date format in Unix?
  • What is the difference between ARG and ENV Docker?
  • What is rsync command Linux?
  • How to Add Music to Snapchat 2021 Android? | How to Search, Add, Share Songs on Snapchat Story?
  • How to Enable Snapchat Notifications for Android & iPhone? | Steps to Turn on Snapchat Bitmoji Notification
  • Easy Methods to Fix Snapchat Camera Not Working Black Screen Issue | Reasons & Troubleshooting Tips to Solve Snapchat Camera Problems
  • Detailed Procedure for How to Update Snapchat on iOS 14 for Free
  • What is Snapchat Spotlight Feature? How to Make a Spotlight on Snapchat?
  • Snapchat Hack Tutorial 2021: Can I hack a Snapchat Account without them knowing?

Copyright © 2025 · News Pro Theme on Genesis Framework · WordPress · Log in