title: Error Code 1 when trying to "pip install psycopg2" in Max OSX Yosemite
body: <p>I am trying to use postgresql in my Django project so I have been trying to install psycopg2 however I keep running into problems. Since I am using a virtualenv, installing psycopg2 through macports isn't helping. I need to find someway to install it as an app within my virtual env.</p>
  
  <p>Here is the error I get when I try to pip install it in my virtualenv:</p>
  
  <pre><code>Downloading/unpacking psycopg2
  Downloading psycopg2-2.5.4.tar.gz (682kB): 682kB downloaded
  Running setup.py     (path:/Users/adfelix2/Documents/Hindsait_Work/Projects/nybc_pilot/build/psycopg2/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'.
  
  ----------------------------------------
  Cleaning up...
  Command python setup.py egg_info failed with error code 1 in         /Users/user/'privateinfo'/my_virtualenv/build/psycopg2
  Storing debug log for failure in /Users/user/.pip/pip.log
  </code></pre>
  
  <p>Seems like I need to add a directory to pg_config? However I am unable to come across anything online that would help me do so. If anybody has an answer to this, in a step-by-step manner, it would be very gladly appreciated. Thank you.</p>