[Pythonmac-SIG] Building packages under Snow Leopard and Python 2.6.x

Ned Deily nad at acm.org
Tue Sep 22 03:17:31 CEST 2009


In article <7FD54A88-9D22-46C8-B25E-7D21EFCCF6A5 at eku.edu>,
 Jerry LeVan <jerry.levan at eku.edu> wrote:
> I have the community version of Python 2.6.2 installed on my
> MacBook Pro running 10.6.1.
> 
> I am trying to build psycopg2  ( 2.0.12) on my mac and am
> no having much luck...
> 
> [mbp:~/python/psycopg2-2.0.12]$ python setup.py build
> running build
> running build_py
> running build_ext
> building 'psycopg2._psycopg' extension
> gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk - 
> fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 - 
> DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.0.12 (dt dec ext  
> pq3)" -DPG_VERSION_HEX=0x080401 -DPSYCOPG_EXTENSIONS=1 - 
> DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -DHAVE_PQPROTOCOL3=1 -I/ 
> Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -I.  
> -I/usr/local/pgsql/include -I/usr/local/pgsql/include/server -c  
> psycopg/psycopgmodule.c -o build/temp.macosx-10.3-fat-2.6/psycopg/ 
> psycopgmodule.o
> In file included from /Library/Frameworks/Python.framework/Versions/ 
> 2.6/include/python2.6/unicodeobject.h:4,
>                   from /Library/Frameworks/Python.framework/Versions/ 
> 2.6/include/python2.6/Python.h:85,
>                   from psycopg/psycopgmodule.c:23:
> /Developer/SDKs/MacOSX10.4u.sdk/usr/include/stdarg.h:4:25: error:  
> stdarg.h: No such file or directory
> In file included from /Library/Frameworks/Python.framework/Versions/ 
> 2.6/include/python2.6/unicodeobject.h:4,
>                   from /Library/Frameworks/Python.framework/Versions/ 
> 2.6/include/python2.6/Python.h:85,
>                   from psycopg/psycopgmodule.c:23:
> /Developer/SDKs/MacOSX10.4u.sdk/usr/include/stdarg.h:4:25: error:  
> stdarg.h: No such file or directory
> lipo: can't figure out the architecture type of: /var/folders/5N/ 
> 5N7bzOiYF3ONFPRhfGuq3k+++TI/-Tmp-//ccch66qm.out
> error: command 'gcc' failed with exit status 1

BTW, this is an unfortunate general problem on 10.6 when building 
packages containing C extension modules using pythons installed by any 
of the more recent python.org installers.  (It's not a problem if you 
are using one of the Apple-supplied pythons.)  The workarounds are (1) 
if necessary install the optional 10.4 SDK from the Xcode package 
included with Snow Leopard, then (2) use gcc-4.0 for the build rather 
than gcc-4.2 by setting CC=/usr/bin/gcc-4.0.

I've opened an issue on the Python bug tracker for this; there are more 
details there:

  http://bugs.python.org/issue6957

-- 
 Ned Deily,
 nad at acm.org



More information about the Pythonmac-SIG mailing list