Compiling/Installing Python 2.7 on OSX 10.6

Ned Deily nad at acm.org
Thu Nov 4 15:23:28 EDT 2010


In article 
<3d9139ae-bd6f-4567-bb02-b21a8ba86e50 at o15g2000prh.googlegroups.com>,
 Jeremy <jlconlin at gmail.com> wrote:

> 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',)

How did you obtain and unpack the source?  It looks like you used 
something that created the old-style "._" hidden forks when extracting 
the source.  The path names look a little suspicious, too: 
/home/jlconlin.  What file system type are these files on?  You 
shouldn't run into problems if you use an HFS+ file system (for 
instance) and extract the tarball from the command line using 
/usr/bin/tar. 
 
> 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

Yes, all of those are to be expected on an OS X 64-bit build.

-- 
 Ned Deily,
 nad at acm.org




More information about the Python-list mailing list