Installing psycopg2 in virtualenv on OSX
In case you’re trying to install the postgresql python library psycopg2 on OSX Snow Leapord in a virtual env, and you get the following error:
assembler (/usr/bin/../libexec/gcc/darwin/ppc/as or /usr/bin/../local/libexec/gcc/darwin/ppc/as) for architecture ppc not installed
You can install psycopg2 via the following command:
sudo env ARCHFLAGS=”-arch i386 -arch x86_64” pip install psycopg2
This will set the architecture flags correctly (removing the ppc architecture from the compile instructions).
Cheers!