I have OS X 10.6.6 Snow Leopard. The OS X default install of python is 2.6.1 in 64 bit mode. Apple nicely installs several python extensions such as numpy and several frameworks for Apple Events.
Most do not recommend upgrading the default Perl on OS X since the OS relies on certain behaviors of Perl at the time of release. Python community seems more optimistic and recommends:
The overwhelming recommendation of the
“MacPython” community is to upgrade
your Python by downloading and
installing a newer version from the
Python standard release page
I have done two attempts at upgrades. The first attempt was to install Python 2.7.1 through MacPorts. The second was just a straight download of Python 2.7.1 from the Python standard release page.
Facts:
- The MacPorts version is installed in
/opt/local/bin/pythonwith frameworks in/opt - The default OS X python 2.6.1 and 2.5.4 remain at
/usr/bin /System/Library/Frameworks/Python.frameworkhas frameworks for python v 2.3, 2.5, 2.6 and “Current”. “Current” is empty.- The download from the python website is installed at
/usr/local/binand is a link to/Library/Frameworks/Python.framework/Versions
2.7 - My path is set so the MacPorts version is first in the path.
Questions and problems:
- The MacPorts version cannot run
pydocs -g. It fails with the error:TclError: out of stack space (infinite loop?)I have tried to download macports version of Tkinter but still no joy. Ideas? - Can I migrate over the Apple installed python support modules or do I need to manually reinstall each one?
- Can I delete the python 2.3 framework in
/System/Library/Frameworks/Python.framework? There does not seem to be a link to these executables in the/usr/bindirectory. - If the recommendation of the “MacPython” community is to “upgrade” why does the system version remain untouched by the python download of 2.7.1?
- Once I figure out all these versions, what is ‘best practice’ on sharing modules between different versions of python that are installed?
I’m not a user of MacPorts, so I don’t have any thoughts on this item.
Manually reinstall each one. I’d recommend installing these in one or more
virtualenvenvironments so as to not pollute your globalsite-packagesdirectories.I wouldn’t delete anything in
/System/Library/Frameworks/. As stated by Alex Martelli in his answer to this SO question, “You should not tamper in any way with the system-supplied Python.”While they use the word “upgrade”, they really mean to perform a completely new install and not use/touch the Apple installed version.
virtualenv
For info on how I’ve installed Python and various packages, check out the following StackOverflow questions:
~/.local?Using the Python.org DMGs will perform Python Framework installs located in
/Library/Frameworks/Python.framework/.