title: Can't install psycopg2 with pip in virtualenv on Mac OS X 10.7
body: <p>I am following Heroku's tutorial to deploy a Django app: <a href="http://devcenter.heroku.com/articles/django#prerequisites">http://devcenter.heroku.com/articles/django#prerequisites</a>. </p>
  
  <p>Everything is working fine until I get to this part: </p>
  
  <pre><code>$ pip install Django psycopg2
  </code></pre>
  
  <p>I can install Django by itself, but the probelm is with psycopg2. </p>
  
  <p>I keep getting this error: </p>
  
  <pre><code>ld: library not found for -lpq
  
  collect2: ld returned 1 exit status
  
  ld: library not found for -lpq
  
  collect2: ld returned 1 exit status
  
  lipo: can't open input file: /var/folders/_4/p6l0y0t51hd4xbq7llbyshmw0000gn/T//cc0L10mI.out (No such file or directory)
  
  error: command 'gcc-4.2' failed with exit status 1
  </code></pre>
  
  <p>I've installed PostgreSQL 9.1 on my machine. </p>
  
  <p>Also, in the output, there are bunch of lines like this: </p>
  
  <pre><code>gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.4 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x090004 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I. -I/usr/include -I/usr/include/postgresql/server -c psycopg/typecast.c -o build/temp.macosx-10.6-intel-2.7/psycopg/typecast.o
  </code></pre>
  
  <p>I'm not really sure what it means, but I do notice that it has "macosx-10.6" in it so I'm wondering if that could be the issue? I'm on 10.7. </p>
  
  <p>Thanks in advance for your help. </p>