Trying to setup postgres with the postgres mac app and hit this error, which I haven\'t been able to solve. Any thoughts?
ImportError: dlopen(/Users/Crai
In your bash environment before you load it, try this:
export DYLD_LIBRARY_PATH=/Library/PostgreSQL/x.y/lib
..replacing the 'x.y' with the version on your system.
..be aware that setting this in your bash profile can interfere with other programs, as KindOfGuy noted.
..of course, if you're not running it from a bash prompt, you'll have to set up your environment in whatever way pyenv lets you. ..you could even edit pyenv itself and place that at the top.
Another alternative is to put this in a python script which runs before you attempt to import psycopg2:
import os
os.environ['DYLD_LIBRARY_PATH'] = '/Library/PostgreSQL/x.y/lib'
..again, replacing 'x.y' with the version on your system in /Library/PostgreSQL.