[Pythonmac-SIG] 'Cleaning house' - getting back to just Apple's Python

Ned Deily nad at acm.org
Sat Aug 28 09:31:46 CEST 2010


In article <i59tqt$g55$1 at dough.gmane.org>,
 Monte Milanuk <memilanuk at gmail.com> wrote:
> I have an older Intel Macbook (circa early 2007) that I have upgraded 
> the hardware and software a bit on over the last few months.  Currently 
> it is running Snow Leopard 10.6.4, with an install of Python 2.6.5.
> 
> Over the course of time, between various upgrades, removing this, 
> reinstalling that, etc. etc. I think I've made somewhat of a mess of my 
> Python install and I'd like to clean house and get back to just the 
> version that shipped with 10.6.x.  No extras or add-ons.  Once I get 
> that kind of under control, then maybe see about upgrading/ or having 
> multiple versions installed, etc.
> 
> 1st question...  What is the default version of Python that shipped with 
> 10.6 Snow Leopard?  I have a Python 2.6.5 install in my Applications 
> directory, and I can't recall if I put that there or if that came with 
> the new OS (I happened to do the OS upgrade around that time frame...).

The Apple-supplied Pythons in 10.6 are 2.6.1 and 2.5.4.  They are 
invoked with /usr/bin/python2.6 (also /usr/bin/python) and 
/usr/bin/python2.5.  The Python Frameworks are in /System/Library.  
Don't try to remove any of this!

>   When I look under /Library/Frameworks/Python.framework/Versions I see 
> the following:
> 
> 
> macbook:~ monte$ ls -al /Library/Frameworks/Python.framework/Versions/
> total 8
> drwxr-xr-x   5 root  admin  170 Mar 23 17:46 .
> drwxr-xr-x   6 root  admin  204 Mar 23 17:17 ..
> drwxrwxr-x  11 root  admin  374 May 12 22:04 2.6
> drwxrwxr-x   9 root  admin  306 Aug 24  2009 3.1
> lrwxr-xr-x   1 root  admin    3 May  7 16:31 Current -> 2.6
> macbook:~ monte$
> 
> If I remove the Python 2.6.5 install from the Applications directory, is 
> that going to affect things here, or is this a separate (OEM) install?

The python.org installer installs most of the Python files into that 
framework.  Some additional files are installed into the 
/Applications/Python x.y directory that the installer creates.  The 
Apple-supplied Pythons do not use either of these directories.

> Sometime in the recent past I remember installing, and then uninstalling 
> Python 3.x... so if I remove the 3.1 directory sub-tree, will that clean 
> out that bit so I can start over fresh?

If you want to clean out both the python.org 2.6 and 3.1 (the only two 
you've installed), the easiest thing to do is:

sudo rm -r /Library/Frameworks/Python.framework
sudo rm -r "/Applications/Python 2.6"
sudo rm -r "/Applications/Python 3.1"

You may also need to edit your shell startup file, likely 
~/.bash_profile or ~/.profile, to remove the modifications to put the 
framework bin directories at the head of $PATH.  And there should be 
some dangling symlinks left behind in /usr/local/bin which can be 
removed, things like /usr/local/bin/python2.6, /usr/local/bin/idle2.6, 
etc.

There is more detail here:  http://bugs.python.org/issue7107

-- 
 Ned Deily,
 nad at acm.org



More information about the Pythonmac-SIG mailing list