ML 10.8.4 and I have installed Python 2.6, 2.7 and 3.3. I keep reading that it's necessary to keep the the 2.6 version around because the system uses it. However, I've not found any software that needs it other than that which I installed (and I can control which version THAT needs - I complied and installed SciPy for 3.3.2 for example). So, using macports I pointed the python link to the 3.3.2 install to see if there is something hidden that I've missed. I've not had any problems.

So I'm wondering if it's even necessary to keep the old versions around. I am aware that this will limit certain versions of python scripts that I install.

Does anyone know what I definitively will break by having python link to 3.3.2 in a base install of ML?

Also, I suspect that the 2.6 version is an old hanger on from Snow Leopard (machine migration) as supposedly, ML uses 2.7. But I can't confirm that.

  • FYI, on a new Mac (w/ OSX 10.8) Python2.5, 2.6 & 2.7 are already installed. So it's not from the migration. – Matthieu Riegler Aug 31 '13 at 1:22

While there are obviously differences in the different versions of Python, there are also differences between the "system" Python and those you install via Python.org, MacPorts, Homebrew, etc. All of these "additional" versions can coexist quite happily with the system versions in /System/Library/Frameworks/Python.framework/Versions - I have 2.3, 2.5.6, 2.6.7, and 2.7.2 on my 10.8.4 iMac which originally came with Lion installed. /usr/bin/python is 2.7.2.

Basically, there is no good reason to get rid of any of the system Pythons (they only take up ~200MB), and some very good reasons to not get rid of them. They are included for a reason, and there are various system utilities and programs that depend on them. You could get strange, unexplained behavior if you remove them, and vital stuff may not work, as Python scripts and libraries are behind some major system tools. Python has been designed to have multiple versions living happily side-by-side, so if your system is set up properly (which I generally trust the Apple engineers to have done), there won't be any conflicts as hypothesized by another answer.

If you want to change which version of Python runs by default when you type python into the Terminal prompt, then change your $PATH environment variable to point toward your installation of choice, do not unlink or change /usr/bin/python. For example, I use MacPorts, so /opt/local/bin is ahead of /usr/bin in my $PATH, so I never run the "system" version 2.7.2. You can then start your scripts with

#!/usr/bin/env python

and it will search your path for the correct binary.

You should have no problems at all using MacPorts point to your version of choice. One thing I would suggest, though, is to keep /opt/local/bin/python pointing to the latest version of Python 2 (2.7.5, currently), and use /opt/local/bin/python3 point to 3.3.2. Yes, you have to remember to add the 3 on the end of the command, but several months back I tried setting python to Py3, and occasionally would get weird errors from some programs expecting Py2 to be there.

Hopefully this helps answer your actual question, please let me know if you need anything else.

  • 1
    " ... but several months back I tried setting python to Py3, and occasionally would get weird errors from some programs expecting Py2 to be there." It is precisely these specifics that I am looking for!!! What broke? What is something you installed beyond a clean install or was it part of OS X clean install? – placeholder Aug 31 '13 at 18:30
  • @rawbrawb - it was other command-line stuff I was using that was expecting /usr/bin/env python to be Py2 instead of Py3. However, it was expecting my install of Py2, not the system version. – MattDMo Aug 31 '13 at 18:39
  • 1
    Unfortunately it was quite a while ago, and I don't remember exactly what the details were, I just remember my take-home being to not let MacPorts link /opt/local/bin/python to Py3, instead use /opt/local/bin/python3 instead. – MattDMo Aug 31 '13 at 18:40

Having multiple versions of Python around isn't actually a bad thing, particularly if certain applications might have version dependencies. The main concern would be that of dependencies and versions — and indirectly permissions.

If you decide to get rid of the older version then be aware there are quite a few items you'll need to reconfigure to ensure everything is able to work just as well as it did before. If you're more concerned with having to manage multiple versions of Python I would recommend virtualenv; it's a nice tool to create isolated Python environments.

Pro's for getting rid of Python 2.6:

• Apple listed Python 2.6 as security-fix-only (no more updates)
• Two versions of Python on the same machine can potentially have conflicts
• It's easier to maintain, while potentially freeing up disk space

Pro's for having two versions of Python:

• Less worrying about certain applications not working because of broken dependencies
• The ability to have different versions of Python!
• Having a newer version allows you to use newer/cool packages

If you decide to commit to deleting Python 2.6 I would check out this excellent and thorough guide to upgrading: http://wolfpaulus.com/jounal/mac/installing_python_osx

If you decide to keep both versions then have a look at virtualenv.

The choice really is ultimately up to you.

  • This doesn't answer the question. I'll restate it ... everyone states that you shouldn't remove the old versions of Python because "it is needed by the system" but I've more of less proven that isn't true for a clean install as I built V3.3.2 from source and that is the only thing being pointed to on the system. And it runs fine. – placeholder Aug 31 '13 at 4:56
  • Yes it does answer the question. look at sentence #1. Unless you list the applications you're using specifically, there's no telling what the consequences would be for deleting the older version. – l'L'l Aug 31 '13 at 4:56
  • As I stated in the OP, it is POSSIBLE to load something that requires an old version. but the system per se does NOT require it otherwise my system would be borked right now. Yes it's nice to have it them there "just in case" but it's not necessary ... unless there is some occasional tool that I'm not aware of. That is the core of the question. Your first sentence simply restates what I stated in the OP. Do you know of any SW that REQUIRES say Python 2.6.X on Mac OS X 10.8.4 ? – placeholder Aug 31 '13 at 5:01
  • 1
    Since you stated 'I keep reading that it's necessary to keep the the 2.6 version around because the system uses it.' then why would you be asking anyway? And where do you 'keep reading this?'. Seems you know the answer already, so just delete the thing and be done with it. – l'L'l Aug 31 '13 at 5:06

i got lots of sw "that requires say python 2.6 on mac os x 10.8.4". whether or not that same sw is on your computer i would not know.?

on a stock system if you delete 2.6 the only way it "won't break" is if you uninstall it correctly and then install the other correctly. fairly simple logic to understand i gather.

  • Can you be more specific as to what software requires 2.6? – sameetandpotatoes Aug 31 '13 at 13:15
  • 1
    There are significant differences between Py2 and Py3 so something that expects Py2 will break on Py3. – placeholder Aug 31 '13 at 18:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .