Python3 on MacOsX Lion?

Ned Deily nad at
Tue Jan 3 00:21:29 EST 2012

In article <eDnMq.3172$Ik5.2555 at newsfe03.iad>,
 K Richard Pixley <rich at> wrote:
> Where would I look to find the current expected status of python3 on 
> MacOsX Lion?
> The distributed binaries aren't capable of allowing extensions that use gcc.
> I can build the source naked, but then it lacks some libraries, notably, 
> readline.
> Attempting to build the full Mac packages fails, even with the few tiny 
> patches I used for 2.7.2.
> Is anyone working on this?  Are there pre-release patches available?

The short answer is: yes, it is being worked on but it has been taking 
longer than it should.

The 64-bit/32-bit installers from for Python 2.7.x and Python 
3.2.x have been being built on 10.6 with gcc-4.2.  OSX 10.7 (Lion) was 
initially released with Xcode 4.1 which still included a version of 
gcc-4.2 similar to what has been available all along in 10.6 (Snow 
Leopard).  However, more recently, Apple has released Xcode 4.2 which 
finally removed gcc-4.2 and now only includes updated versions of 
llvm-gcc-4.2 (gcc front-end with an llvm code generator backend) and 
clang (clang front-end with an llvm backend).  Apple has made it clear 
that they want developers and other users to move eventually to clang 
and that llvm-gcc is an interim step towards the migration to clang. 
While there are other reasons for that move (like the change in gcc 
licensing), I believe Apple believes that clang will provide an 
all-around better build experience (better code, better checking, better 
diagnostics, more flexibility).  But, as with any major change to a 
build compiler and environment, lots of nitty and often knotty problems 
are to be expected.  (For an idea of the breadth of them, peruse the 
MacPorts project mailing lists for all the issues they've been 
discovering in the many open source packages they support since they've 
moved to using clang by default.)  Python is no exception.   There are 
already a couple of fixes that have been applied for upcoming Python 
releases to deal with either llvm-gcc or clang issues.

To further complicate things, prior to the release of Lion, Apple made a 
preliminary version of Xcode 4 available for Snow Leopard through the 
Mac App Store but appears to have removed it for new purchases after 
Lion was released although it seems that previous purchasers and paying 
members of the Mac Developer program can get updates for it.  So, now 
some 10.6 users also no longer have gcc-4.2, although they do have the 
supported option of reverting to the most recent Xcode 3 release for 
10.6 which is free and still available through the Apple Developer 
Connection website.

The PSF (via also supplies 32-bit-only installer variants 
for OS X 10.3+ which were great for building applications to run on 
multiple versions of OS X.  But since Xcode 4 doesn't ship the necessary 
SDK (10.4u) and gcc-4.0, that installer version is also problematic on 
10.7.  We need to be careful in developing any fixes that we don't 
inadvertently break anything for older OS X releases like 10.5.  So, 
it's all a bit of mess at the moment with *a lot* of variables.

I had hoped to complete a comprehensive set of tests of the most 
important combinations of build environments with the three current 
active branches of python development (2.7.x, 3.2.x, and the future 3.3) 
for 10.7, 10.6, as well as baselines on 10.5 and 10.4 several weeks ago 
but, unfortunately, other events intervened.  Such is the downside of 
all-volunteer projects.  But I will be working on completing this over 
the next couple of weeks and, after review by the other core developers, 
will summarize the known issues and suggested fixes on the 
website (with pointers posted here).  I expect that we will then need to 
push maintenance releases of 2.7.x and 3.2.x.  In the meantime, the 
safest approach is to continue to build on OS X 10.6 with Xcode 3 

 Ned Deily,
 nad at

More information about the Python-list mailing list