I am unable to use pymc
along with psycopg2
. The following simple snippet from the tutorial:
import pymc as pm
with pm.Model() as model:
x = pm.Normal('x', mu=0., sd=1)
results in the following error:
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.
I was able to fix this problem by adding:
export DYLD_FALLBACK_LIBRARY_PATH=$DYLD_FALLBACK_LIBRARY_PATH:/Users/josh/anaconda/envs/py27/lib
to my shell init file .bashrc
. However, and this is the part I don't understand, that line breaks psycopg2
:
---> 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
How can I have psycopg2
and pymc
(here theano
) live happily together?
This is on OS X with a Python 2.7.6 installation with an Python environment created with conda.
The development version of Theano don't need changes to DYLD_FALLBACK_LIBRARY_PATH. So undo the change to it and update your Theano version. From:
http://www.deeplearning.net/software/theano/install.html#bleeding-edge-install-instructions
Run one of those 2 command depending of your need:
pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git --install-option='--prefix=~/.local'
pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git
EDIT: I removed the link to an answer elsewhere and copied the answer here. Thanks