[Pythonmac-SIG] Python development on OSX

Bill Janssen janssen at parc.com
Wed Jan 19 01:29:08 CET 2011


Christopher Barker <Chris.Barker at noaa.gov> wrote:

> On 1/17/11 9:17 AM, Bill Janssen wrote:
> >> And- I want to update the default python that came om my macbook pro to 2.7.
> >> Should I do install that from Python.org?
> >
> > My advice?  I've never had good luck trying to "update" the default
> > Python that comes with the Mac.
> 
> Bill -- I'm really curious what issues you've had -- I haven't tried
> to use Apple's Python is many years (OS-X 10.2, I think) -- and it
> used to be painful to do so. Since then I've stuck with the Python.org
> versions, and had no problems (at least none that would have been
> solved by using Apple's Python).

In general, there are issues around site-packages, paths, and other such
things.  I don't think you and I necessarily have much trouble with it,
but I tend to help others with Python on Macs, and they seem to get into
all kinds of trouble.  The best one I've found is one group who had
decided to upgrade their Leopard Python to 2.6.  They'd installed the
python.org Python, removed the symlink /usr/bin/python, and re-linked
/usr/bin/python to the 2.6 version.  They were happy, but plagued by odd
problems with their machines that didn't (to them) seem to be
Python-related.

Another problem I've run into more than once was that the user had
installed different incompatible versions of an extension, and couldn't
see why an application (with an embedded Python interpreter) was
misbehaving -- it was getting the wrong version of the extension.

Not sure this is much use to anyone, but here's my decision tree, which
has worked well for me over the past 7 years:

> 1) Do I do a bunch of unix-y command line stuff in general, and not
> want to develop OS-X GUIs?

if yes -- use system Python.

if no:
 
> Do I need/want a newer version than Apple provides?

if yes: build non-framework version from source.

> Do I need/want to use py2app to distribute my app(s)?

Never happens.

Do I want to use pre-build binaries of common hard-to-build packages?

if yes: cry about the general unfairness of the world, then build them
from source instead to work with the system Python.

Bill


More information about the Pythonmac-SIG mailing list