Monday, October 28, 2013

Re: Psycopg2 on Mac OS X (Snow Leopard)

Good afternoon,

I just had this exact same problem and it took me a while to find the solution.

On OSx there is a separate library path variable for .dylib library files. I added the following to my .bashrc (or.bash_env or however you set up your shell environment).

export DYLD_LIBRARY_PATH="/usr/local/Cellar/openssl/1.0.1e/lib/:$DYLD_LIBRARY_PATH"

The folder "/usr/local/Cellar/openssl/1.0.1e/lib/" contains the libssl.1.0.0.dylib file that Python is trying to load. You will need to find where your copy is installed (find / -name libssl.1.0.0.dylib) and adjust your environment variable setting accordingly. After that I was able to run my Django server with no problems.

On Sunday, October 27, 2013 10:20:40 AM UTC-4, Skip Montanaro wrote:
I'm working my way through my first non-tutorial Django project. I
plan to deploy it (at least initially) on Heroku. I'm at the point
where I have my basic structure laid out and am proceeding to model
definition. Heroku's default database is PostgreSQL, which I'm
comfortable with, and seems to be installed properly there. The
locally built psycopg2 module (2.5.1) is missing libssl, however:

(venv)topten% python manage.py shell
ImportError: dlopen(/Users/skip/heroku/topten/venv/lib/python2.7/site-packages/psycopg2/_psycopg.so,
2): Library not loaded: libssl.1.0.0.dylib
  Referenced from:
/Users/skip/heroku/topten/venv/lib/python2.7/site-packages/psycopg2/_psycopg.so
  Reason: image not found

Looking on my Mac running Snow Leopard (10.6.8), I only see 0.9.x
versions of libssl in /usr/lib. I have no libssl in my MacPorts
directory (/opt/local/lib).

Where did whatever built psycopg2 (pip?) get the idea that I had
libssl 1.0? More importantly, how can I get past this bump in the
road?

Thanks,

Skip Montanaro

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ad18ed90-ae0c-4e80-b942-0410ffc0c144%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment