[Pythonmac-SIG] managing python 2.4 and 2.5 on leopard

Christopher Barker Chris.Barker at noaa.gov
Mon Aug 11 06:03:40 CEST 2008


Warren Harris wrote:
> I'm trying to understand the correct way to manage both a 2.4 and 2.5
> installation on the same machine (mac 10.5.4). Actually, I have several
> installed already, and I'd like to clean up this mess, but I'm afraid of
> breaking things. 

You'll only break things if the things you uninstall are using them!

Anyway, here is my advise:

For 2.5: use either Apple's or the one from python .org. You can search 
this list for pluses and minuses, but I'd go with python.org's. A bit 
more about that later...

> 1) python that comes with leopard: 

This is Apple's -- don't mess with it -- Apple uses it for some utilities.

> 2) python installed by macports (can't remember why I seemed to need this,
> or that the system python wasn't enough):

If you're not using macports for other stuff, I'd get rid of this one.

> 3) python 2.4 installed from dmg:
> http://www.pythonmac.org/packages/py24-fat/dmg/python-2.4.4-macosx2006-10-18.dmg
> -- I needed 2.4 for a project):

If you still need 2.4 for something then keep this one.

> 4) looks like I've got a 2.3 installed too
> (/System/Library/Frameworks/Python.framework/Versions/2.3)

If you're not using it, you don't need it, but it won't hurt to have it 
there.

> - Is there a better way to install 2.4 to live along side 2.5?

nope, you've got it fine.

> - How to uninstall the 2.4 version cleanly?

1) you don't need to -- it won't hurt to have it there.
2) delete: /Library/Frameworks/Python.framework/Versions/2.4
    delete whatever says 2.4 under Applications/MacPython (I think -- I 
don't have a mac at home)

> - Why does one live under /System/Library and the other under /Library (I
> notice a bunch of things under /Library that appear to be duplicates, e.g.
> perl, tcl, etc)?

/System is for stuff installed and maintained by Apple -- don't mess 
with anything there.

/Library is for stuff installed by third parties -- that's where you put 
an updated python, etc.

> - Should I upgrade my system 2.5 version to 2.5.2 (and the correct method)?

No. Do not upgrade anything of Apple's. However, you might want 2.5.2, 
in which case, install the binary from python.org, it will go into 
/Library/Frameworks/...

Any number of python installations can live quite happily on one system. 
The question is, which do you get when you type:

$ python

That will be determined by your PATH environment variable. Type:

$ echo $PATH

to see what yours is. YOU can change it by editing your ~/.profile or 
~./bash_profile file (whichever you have).

Once you've got the one you want as default, you can get another one by 
typing:

$ python24

or

$ python25

(or putting that in your #! line)

Any extra packages you need will need to be installed in the version you 
want them for, maybe one for each version. If you install binaries, make 
sure they are for the version you want. If you install with setup.py, 
make sure to run setup.py with the version you want. If you use 
easy_install, it's a bit trickier. easy_install will use one of them by 
default. I'm not entirely sure how to get it to use another python -- 
I'd have to poke around a bit on my Mac. Maybe someone else here knows.

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

NOAA/OR&R/HAZMAT         (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception


More information about the Pythonmac-SIG mailing list