[Distutils] [buildout] latest bootstrap.py fails on all 3 pythons that ship with Mac OS X Lion

Chris Withers chris at simplistix.co.uk
Thu Dec 29 12:43:31 CET 2011


Hi All,

I just upgraded a machine I want to use as a build server to Mac OS X 
Lion. It appears that Lion ships with Python 2.5, 2.6 and 2.7, but 
bootstrap.py fails with each of these:

$ python2.5 bootstrap.py
The required version of setuptools (>=0.6c11) is not available, and
can't be installed while this script is running. Please install
  a more recent version first, using 'easy_install -U setuptools'.

(Currently using setuptools 0.6c9 
(/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python))

Okay, so lets try doing what we're told:

$ sudo /usr/bin/easy_install-2.5 -U setuptools
...
Using 
/Library/Python/2.5/site-packages/setuptools-0.6c12dev_r88846-py2.5.egg
...
$ python2.5
...
 >>> import setuptools
 >>> setuptools.__version__
'0.6c12'

Right, so we're all good to go?

$ python2.5 bootstrap.py
The required version of setuptools (>=0.6c11) is not available, and
...

Wha? My guess here is that the setuptools that ships with MacOS is in 
/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python, 
and so while the bootstrap does all its hard work to get rid of 
site-packages, all it's actually doing is getting rid of the setuptools 
it can work with. Any ideas on what needs to be done to fix the bootstrap?

Now, the failures in python2.6 and 2.7 are similar and all the more bizarre:

$ python2.6 bootstrap.py
Traceback (most recent call last):
   File "bootstrap.py", line 159, in <module>
     import pkg_resources
...
   File 
"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plistlib.py", 
line 436, in getData
LookupError: unknown encoding: ascii

Which is odd, since importing pkg_resources outside of the bootstrap 
works fine:

$ python2.6
Python 2.6.7 (r267:88850, Jul 31 2011, 19:30:54)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on 
darwin
Type "help", "copyright", "credits" or "license" for more information.
 >>> import pkg_resources
 >>>

2.7 fails in the same way:

$ python2.7 bootstrap.py
Traceback (most recent call last):
   File "bootstrap.py", line 159, in <module>
     import pkg_resources
...
   File 
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", 
line 436, in getData
LookupError: unknown encoding: ascii

Any ideas?

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
            - http://www.simplistix.co.uk


More information about the Distutils-SIG mailing list