22

I want to update my Python framework on Mac and delete the old versions but I am not sure if is safe to

rm -fr /Library/Frameworks/Python.framework/Versions/2.4 - 2.5 - 2.6 -3.0 etc.

Any suggestion?

fabrizioM
  • 46,639
  • 15
  • 102
  • 119

2 Answers2

31

Yes, it's safe.
The Mac's system python's are in /System/Library/....
.dmg's downloaded and installed from python.org are placed in /Library/....
Don't delete the /System ones, but the /Library ones are user installed, so they should be safe to delete.

snapshoe
  • 13,454
  • 1
  • 24
  • 28
  • I personally have done this-- I've installed python.org's .dmg's, then removed them and installed from source with `homebrew`. – snapshoe Oct 16 '10 at 22:59
  • 5
    To completely delete the old ones, you can also delete the corresponding folders installed by the python.org installers into `/Applications`, either `/Applications/MacPython 2.n` or `/Applications/Python m.n`. The final piece is to delete the corresponding symlinks in `/usr/local/bin` (*not* `/usr/bin`!) – Ned Deily Oct 17 '10 at 00:12
  • +1 Ned. Agreed. I forgot those steps, but I remember doing them. – snapshoe Oct 17 '10 at 00:32
  • It's safer not to mess with /System/Library/Frameworks/Python.framework/ – mel Oct 22 '15 at 20:51
  • I'm not able to do the above command. I get "Operation not permitted" even when I use sudo. @snapshoe – jonnyd42 Dec 01 '17 at 01:02
-1

No, it's not safe. Generally, don't mess with the Python that comes with your OS, many system tools depends on having a specific version of Python.

Lie Ryan
  • 62,238
  • 13
  • 100
  • 144
  • 5
    Yes, you should not mess with Python files that are part of an OS distribution. But the paths referenced by the OP are *not* to the Pythons that come with OS X, rather they are ones installed by the python.org installer or other third-party installers. – Ned Deily Oct 17 '10 at 00:15
  • 1
    /Library/Frameworks/Python.framework is not the system one – skywalker Jan 14 '16 at 18:38