title: psycopg2, pymc, theano and DYLD_FALLBACK_LIBRARY_PATH
body: <p>I am unable to use <code>pymc</code> along with <code>psycopg2</code>. The following simple snippet from the tutorial:</p>
  
  <pre><code>import pymc as pm
  with pm.Model() as model:
      x = pm.Normal('x', mu=0., sd=1)
  </code></pre>
  
  <p>results in the following error:</p>
  
  <blockquote>
    <p>Exception: The environment variable 'DYLD_FALLBACK_LIBRARY_PATH' does
    not contain the '/Users/josh/anaconda/envs/py27/lib' path in its
    value. This will make Theano unable to compile c code. Update
    'DYLD_FALLBACK_LIBRARY_PATH' to contain the said value, this  will fix
    this error.</p>
  </blockquote>
  
  <p>I was able to fix this problem by adding:</p>
  
  <pre><code>export DYLD_FALLBACK_LIBRARY_PATH=$DYLD_FALLBACK_LIBRARY_PATH:/Users/josh/anaconda/envs/py27/lib
  </code></pre>
  
  <p>to my shell init file <code>.bashrc</code>. <strong>However</strong>, and this is the part I don't understand, that line breaks <code>psycopg2</code>:</p>
  
  <pre><code>---&gt; 50 from psycopg2._psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
       51 
       52 from psycopg2._psycopg import Binary, Date, Time, Timestamp
  
  ImportError: dlopen(/Users/josh/anaconda/envs/py27/lib/python2.7/site-packages/psycopg2/_psycopg.so, 2): Library not loaded: @loader_path/../../../libpq.5.dylib                                                                                                 
    Referenced from: /Users/josh/anaconda/envs/py27/lib/python2.7/site-packages/psycopg2/_psycopg.so
    Reason: image not found
  </code></pre>
  
  <p>How can I have <code>psycopg2</code> and <code>pymc</code> (here <code>theano</code>) live happily together?</p>
  
  <p>This is on OS X with a Python 2.7.6 installation with an Python environment created with <a href="http://docs.continuum.io/conda/index.html" rel="nofollow">conda</a>.</p>