Trying to install psycopg2 on OSX results in the following:
building \'psycopg2._psycopg\' extension
creating build/temp.macosx-10.6-universal-2.6
creating
It seems that there was something wrong with the ARCHFLAGS actually sticking, so finally using:
sudo env ARCHFLAGS="-arch i386 -arch x86_64" pip install psycopg2
actually worked.
The problem is that the Python 2.6 included with OS X 10.6 was built for three supported architectures (i386, x86_64, and ppc for compatibility with earlier releases of OS X) and Python's Distutils tries to ensure that all C extension modules are built with the same arch
s as the Python interpreter and library. But Xcode 4 has apparently removed support for PPC. Until an official patch is available, you can either:
ARCHFLAGS
is the way to do that)or you could build and install everything you need using a third-party package manager, like MacPorts.
sudo port install py27-psycopg2 # installs Python2.7, portgresql, and pysycopg2