title: Why can't I install psycopg2? (Python 2.6.4, PostgreSQL 8.4, OS X 10.6.3)
body: <p><b>ORIGINAL MESSAGE (now outdated):</b></p>
  
  <p>After running python setup.py install I get the following:</p>
  
  <pre><code>Warning: Unable to find 'pg_config' filebuilding 'psycopg2._psycopg' extension
  gcc-4.0 -arch ppc -arch i386 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -   DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.2.1 (dt dec ext pq3)" -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. -c psycopg/psycopgmodule.c -o build/temp.macosx-10.3-fat-2.6/psycopg/psycopgmodule.o
  unable to execute gcc-4.0: No such file or directory
  error: command 'gcc-4.0' failed with exit status 1
  </code></pre>
  
  <p>There's probably something screamingly obvious there to anyone who knows the first thing about back-end web programming, but unfortunately it's all gobbledegook to me. The psycopg2 documentation was not helpful.</p>
  
  <hr>
  
  <p><b>UPDATE early 12 June</b>: After updating all my software, the error message has changed.</p>
  
  <p>Now, when I run "python setup.py install" I get the following:</p>
  
  <pre><code>Warning: Unable to find 'pg_config' filebuilding 'psycopg2._psycopg' extension
  gcc-4.0 -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.2.1 (dt dec ext pq3)" -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. -c psycopg/psycopgmodule.c -o build/temp.macosx-10.3-fat-2.6/psycopg/psycopgmodule.o
  </code></pre>
  
  <p>followed by a very long list of other error messages.</p>
  
  <p>It may or may not be relevant that when I put "gcc-4.0" into Terminal, it comes back with:</p>
  
  <pre><code>i686-apple-darwin10-gcc-4.0.1: no input files
  </code></pre>
  
  <hr>
  
  <p><b>UPDATE 12:41 GMT 12 June:</b> I thought the macports installation had worked, but when I tried running a site it ended with the following error:</p>
  
  <pre><code>raise ImproperlyConfigured("Error loading psycopg2 module: %s" % e)
  django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: No module named psycopg2
  </code></pre>
  
  <p>So I guess that means that psycopg2 hadn't installed properly after all. So I'm back to square one.</p>