views:

267

answers:

1

I've been having nothing but trouble with python2.6 and Snow Leopard. One major problem is 32 vs 64-bit libraries.

The other manifests itself like this:

tppllc-mbp15$ sudo easy_install-2.6 appscript
Searching for appscript
Reading http://pypi.python.org/simple/appscript/
Reading http://appscript.sourceforge.net
Best match: appscript 0.21.1
Downloading http://pypi.python.org/packages/source/a/appscript/appscript-0.21.1.tar.gz#md5=351f3e493f9259516fce6eecde155195
Processing appscript-0.21.1.tar.gz
Running appscript-0.21.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-DiXejT/appscript-0.21.1/egg-dist-tmp-brxccx
Compiling with an SDK that doesn't seem to exist: /Developer/SDKs/MacOSX10.4u.sdk
Please check your Xcode installation
ld: library not found for -lbundle1.o
collect2: ld returned 1 exit status
ld: library not found for -lbundle1.o
collect2: ld returned 1 exit status
lipo: can't open input file: /var/tmp//ccO2E68V.out (No such file or directory)
error: Setup script exited with error: command 'gcc-4.0' failed with exit status 1

Does anyone have any idea where that "Compiling with an SDK that doesn't seem to exist: /Developer/SDKs/MacOSX10.4u.sdk" is coming from? There's no mention of 10.4 in any of the files for this project.

appscript isn't the only project that fails, just one of many.

I tried reinstalling xcode, and my entire operating system--starting on a clean machine--and there are problems.

If I install the package under python2.5 it works. That's my solution for now: to stay with python 2.5

+1  A: 

It appears you have likely installed a python 2.6 from python.org or some other 3rd-party installer. The python.org python's are currently built only as 32-bit (i386 and ppc) and are compatible with OS X 10.3 through 10.6. To do that, they are built with the 10.4u SDK which is available via the 10.6 Xcode installer (on the 10.6 Installation DVD and elsewhere), however that SDK is not installed by default. Run the 10.6 Xcode installer again and select it. Then builds of python packages with C extension module should work fine.

Another solution is to just stick with the Apple-supplied Python 2.6.1 in 10.6 (which runs as 64-bit by default) in which case you need to fix your $PATH or be careful to use /usr/bin/easy_install-2.6.

Ned Deily
Thanks. While I have installed python from Xcode, I most likely have confused my system with dual python 2.6 installs. I'm going to try to clean it up, because I have continous 32/64-bit library headaches. (I spent several DAYS trying to get PyGraphViz, PyPlot, etc running on OSX 10.6 before giving up and doing it on Linux!)
ראובן
There's no particular reason why you can't have multiple python 2.6 installs; it's pretty common on OS X with framework builds (the system I'm typing on has 4 of them, not counting development builds). Tricks are managing PATH correctly, understanding that each instance has its own site-library and, consequently, packages and scripts like easy_install, and understanding the architecture(s) of each instance (i386/ppc, x86_64/i386/ppc, etc). Also beware when using Xcode for Python dev of possible Framework precedence issues, i.e /Library/Frameworks searched before /System/Library/Frameworks.
Ned Deily
Also, you may be able to save yourself a lot of extra work if you can install the packages from MacPorts. I don't have any personal experience with PyGraphiz but there appears to be a version available. `sudo port install graphviz +python26 py26-graphviz` *may* just do the trick, installing everything including the MacPorts python2.6. You may need to adjust the variants for a few packages.
Ned Deily