title: Install psycopg2 for Anaconda Python
body: <p>I have Anaconda Python 3.4, however whenever I run older code I switch to Anaconda Python 2.7 by typing "source activate python2". My issue is that I have psycopg2 installed for Anaconda Python 3.4, but not for Anaconda Python 2.7. When I run pip install psycopg2 (on Python 2.7) I get the following message:</p>
  
  <pre><code>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'.
  </code></pre>
  
  <p>I am fairly new to programming and need help in:</p>
  
  <pre><code>1. Obtaining directory containing pg_config
  2. Finding the path to Anaconda Python 2.7 
  3. Adding pg_config to the PATH.
  </code></pre>
  
  <p>After I complete these steps I should be able to pip install Install psycopg2</p>