Compiling/Installing Python 2.7 on OSX 10.6

Jeremy jlconlin at gmail.com
Thu Nov 4 10:53:38 EDT 2010


I'm having trouble installing Python 2.7 on OSX 10.6  I was able to
successfully compile it from source, but ran into problems when I did
make install.  The error I got (I received many similar errors) was:

/usr/bin/install -c -m 644 ../LICENSE /home/jlconlin/Library/
Frameworks/Python.framework/Versions/2.7/lib/python2.7/LICENSE.txt
PYTHONPATH=/home/jlconlin/Library/Frameworks/Python.framework/Versions/
2.7/lib/python2.7  DYLD_FRAMEWORK_PATH=/home/jlconlin/src/Python-2.7/
build: \
		./python -Wi -tt /home/jlconlin/Library/Frameworks/Python.framework/
Versions/2.7/lib/python2.7/compileall.py \
		-d /home/jlconlin/Library/Frameworks/Python.framework/Versions/2.7/
lib/python2.7 -f \
		-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
		/home/jlconlin/Library/Frameworks/Python.framework/Versions/2.7/lib/
python2.7
Listing /home/jlconlin/Library/Frameworks/Python.framework/Versions/
2.7/lib/python2.7 ...
Compiling /home/jlconlin/Library/Frameworks/Python.framework/Versions/
2.7/lib/python2.7/._BaseHTTPServer.py ...
Sorry: TypeError: ('compile() expected string without null bytes',)
Compiling /home/jlconlin/Library/Frameworks/Python.framework/Versions/
2.7/lib/python2.7/._Bastion.py ...
Sorry: TypeError: ('compile() expected string without null bytes',)
Compiling /home/jlconlin/Library/Frameworks/Python.framework/Versions/
2.7/lib/python2.7/._CGIHTTPServer.py ...
Sorry: TypeError: ('compile() expected string without null bytes',)

As you can see I am compiling/installing in my home directory instead
of for the whole system.  The script I used to compile Python 2.7 is:

#! /bin/sh

export CFLAGS="-arch x86_64"
export LDFLAGS="-arch x86_64"

../configure --prefix=$HOME/usr/local \
    --enable-framework=$HOME/Library/Frameworks \
    --disable-toolbox-glue \
    MACOSX_DEPLOYMENT_TARGET=10.6

make
make install

Can anyone help me fix the install error?

Thanks,
Jeremy

PS. Python compiled correctly, but a few modules were not found/made
but I don't think they are important.

Python build finished, but the necessary bits to build these modules
were not found:
_bsddb             dl                 gdbm
imageop            linuxaudiodev      ossaudiodev
spwd               sunaudiodev
To find the necessary bits, look in setup.py in detect_modules() for
the module's name.







More information about the Python-list mailing list