I did a simple pip install psycopg2 on mac system. It installed fine, but when I try to use psycopg2 I get the error:
Reason: Incompatible library version: _psycopg.so requires version 1.0.0 or later, but libssl.0.9.8.dylib provides version 0.9.8
pip freeze shows psycopg2==2.4.5 just right. I have installed psycopg2 on several virtualenvs but this is the first time I am seeing such error. I tried uninstalling and reinstalling, same results. Please help
I ran into a similar problem after upgrading to Mountain Lion.
Instead of copying libssl.* files per Slack’s suggestion, make sure that
/usr/lib/libssl.dylibis actually a soft link to the most up-to-date version of the library.E.g., on my machine,
ls -l /usr/lib/libssl*gives:If
libssl.dylibdoesn’t link to the version that the error version mentions, make sure you have that version of the library, and then make sure/usr/lib/libssl.dylibpoints to it, and not an older version.If the link doesn’t exist, create it like so
using, of course, the proper locations for your machine. For me, this turned out to be:
Edit:
It seems like some are having trouble with part of my solution. Namely, deleting these important libraries even temporarily causes problems with the operating system.
Per Purrell’s answer, make sure you include the
-fsflags when you use thelncommand, which helps ensure that the libraries don’t go missing for a short period of time. E.g.,