[Pythonmac-SIG] Confused about framework build

Christopher Barker Chris.Barker at noaa.gov
Tue Feb 27 18:23:33 CET 2007


Kent Johnson wrote:
> I am coming to Mac Python development after several years on Windows

Welcome

> I have installed the framework build of Python 2.4 from pythonmac.org.

good choice!

> Questions:
> - How can I have Python 2.4 and 2.5 both available?

Yes, certainly.

> I am developing a 
> web site that will be deployed under 2.4 but I would like to have 2.5 
> available for other use.

good plan.

> pythonmac.org says, "framework builds of the 
> same thing do not coexist peacefully." What is the problem with 
> installing multiple framework builds?

by "same thing" I think that means same version (minor version). i.e. it 
would be a trick to have two Framework Builds of Python2.4 installed at 
the same time. Having 2.4 and 2.5 at the same time is no problem.

> Can I install the MacPorts version 
> of Python 2.5 (for command line use) instead?

You could, but there's not need. Indeed, I'd probably use the MacPorts 
version for the web server if you were to go that route.

> - Do I have to install the pythonmac version of add-on libraries?

Pretty much, yes.

> For 
> example pythonmac has pysqlite2 version 2.2.2 but MacPorts has version 
> 2.3.3;

Many things build just fine out of the box with setup.py build or 
easy-install, so updating a few things shouldn't be too hard. If you run 
into issues, you'll get help here. And you may not need the latest anyway.

> can I install the more recent MacPorts version and use it with 
> the framework build?

No. you need to be all Framework or all MacPorts.

> Any help or pointers to help gratefully accepted.

after installing both 2.4 and 2.5, you should have:

python2.4 and python2.5 somewhere on your PATH. It's buried in the 
Framework bin dir, with a link in /usr/local/bin on my system -- I don't 
recall if I put that link in myself. The mpkg will have altered your 
.profile, adding the framework bin dir to your PATH. Your web app 
probably won't get that same PATH, so you may have to set that up somehow.

I think the last one installed will end up as the default. In general, 
you'll want to be explicit in your #! lines as to which version you want:

#!/usr/bin/env python2.4

I think this is good practice in any case.

This all is easier than on Windows.

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

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

Chris.Barker at noaa.gov


More information about the Pythonmac-SIG mailing list