I performed the following procedure:
1) $ sudo pip install psycopg2
This gave me the following error:
Downloading/unpacking psycopg2 Running setup.py egg_info for package psycopg2 no previously-included directories found matching 'doc/src/_build' Installing collected packages: psycopg2 Running setup.py install for psycopg2 building 'psycopg2._psycopg' extension llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.3 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x090004 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I. -I/usr/include -I/usr/include/postgresql/server -c psycopg/psycopgmodule.c -o build/temp.macosx-10.7-intel-2.7/psycopg/psycopgmodule.o unable to execute llvm-gcc-4.2: No such file or directory error: command 'llvm-gcc-4.2' failed with exit status 1 Complete output from command /usr/bin/python -c "import setuptools;__file__='/Users/boltellinfomedia/mukul/mukul/build/psycopg2/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install
2) Then I searched the Internet to install llvm-gcc-4.2 and from this http://developer.apple.com/library/mac/#releasenotes/DeveloperTools/RN-llvm-gcc/_index.html found out what I needed install xcode
Also from this problem installing psycopg2 on OSX Lion I found out that I can install psycopg2 through macports, but then from http://www.macports.org/install.php I found out that I need xcode again.
3) Finally, I tried installing Xcode from the Apple store, it downloaded a 1.6 gigabyte file and after that said that it is now installed on my system. Here is a screenshot of the same
! [macports mounted image] [1]
4) And then I tried installing macports through the dmg file, available at http://www.macports.org/install.php , but it says that xcode is not installed on my system yet. Here is a screenshot of the same.! [when trying to install macport, xcode not installed message appears] [2]
mukul source share