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

William Kyngesburye woklist at kyngchaos.com
Wed Sep 16 22:38:07 CEST 2009


I used this without any problems:

export PATH="/usr/local/pgsql/bin:$PATH"
export ARCHFLAGS="-arch i386"

python setup.py build


Compilation is correctly using gcc-4.2 and the 10.6 sdk.  This is with  
the system python.

Did you install Python from python.org?  They probably have the  
distutils using the 10.4 SDK and ppc+intel.  This needs gcc-4.0, but  
'gcc' will run 4.2, as Emanuele pointed out.

On Sep 16, 2009, at 2:21 PM, Emanuele Santos wrote:

> Try using gcc 4.0, Snow Leopard is using gcc-4.2 by default.
>
> export CC=/usr/bin/gcc-4.0
> export CXX=/usr/bin/g++-4.0
>
> -- Emanuele.
>
> On Sep 16, 2009, at 7:31 AM, Jerry LeVan wrote:
>
>> Hi
>>
>> 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
>>
>> ***************************
>> It looks like it is trying to build against a very old toolkit  
>> ( 10.4)...
>>
>> The error messages are not clear to me.. the stdarg.h file exists  
>> in the 10.4u directory and
>> includes the 'standard' stdarg.h
>>
>> I have built a 32 bit i386 only version of postgresql ( 8.4.1)
>>
>> Any suggestions?

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"History is an illusion caused by the passage of time, and time is an  
illusion caused by the passage of history."

- Hitchhiker's Guide to the Galaxy




More information about the Pythonmac-SIG mailing list