title: Install libpq-dev on Mac OS X
body: <p>I'm trying to run Django with a Postgresql backend on my local Mac OS X.  I've installed Django using pip:</p>
  
  <pre><code>sudo pip install Django
  </code></pre>
  
  <p>I've installed Postgresql with one of the binary installers <a href="http://www.postgresql.org/download/macosx/" rel="noreferrer">here</a>.</p>
  
  <p>But when I try to install psycopg2 I get an error (pasted below) that it can't find pg_config.  </p>
  
  <p>From <a href="https://stackoverflow.com/questions/5420789/how-to-install-psycopg2-with-pip-on-python">this question</a> it seems like I should install <code>libpq-dev</code> but I'm not sure how.  </p>
  
  <p>I've tried installing <code>libpqxx</code> with MacPorts, but that hasn't done anything.</p>
  
  <p>How do I get libpg-dev installed?  Or is there something else I'm missing?</p>
  
  <pre><code>henrietta:~ $ pip install psycopg2
  Downloading/unpacking psycopg2
    Downloading psycopg2-2.4.5.tar.gz (719Kb): 719Kb downloaded
    Running setup.py egg_info for package psycopg2
      Error: pg_config executable not found.
  
      Please add the directory containing pg_config to the PATH
      or specify the full executable path with the option:
  
          python setup.py build_ext --pg-config /path/to/pg_config build ...
  
      or with the pg_config option in 'setup.cfg'.
      Complete output from command python setup.py egg_info:
      running egg_info
  
  creating pip-egg-info/psycopg2.egg-info
  
  writing pip-egg-info/psycopg2.egg-info/PKG-INFO
  
  writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
  
  writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
  
  writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'
  
  warning: manifest_maker: standard file '-c' not found
  
  Error: pg_config executable not found.
  
  
  
  Please add the directory containing pg_config to the PATH
  
  or specify the full executable path with the option:
  
  
  
      python setup.py build_ext --pg-config /path/to/pg_config build ...
  
  
  
  or with the pg_config option in 'setup.cfg'.
  
  ----------------------------------------
  Command python setup.py egg_info failed with error code 1
  Storing complete log in /Users/thomas/.pip/pip.log
  </code></pre>