dlopen(Library not loaded: libssl.dylib) – fail to import psycopg2 in virtualenv


This is my scenario, I set up virtualenv on my MacBook (love that virtualenv btw).  I installed Jupyter in one of my Virtual Environments (pip install jupyter).  While running Jupyter, I attempted to import psycopg2 (I had previously installed this module in another virtualenv by the way). Then I received an error like the one below:

 “dlopen(Library not loaded: libssl.dylib)”

Fixing this is simple.  Copy the following files in to your /usr/local/lib folder

  • libssl.1.0.0.dylib
  • libcrypto.1.0.0.dylib

I found these files in my Postgres installation (/Library/PostgreSQL/9.5/lib), navigated there and then ran the following command

sudo cp libssl.1.0.0.dylib libcrypto.1.0.0.dylib /usr/local/lib/

After that, I am able to import psycopg2 on Jupyter running in my virtualenv with no problem!

Advertisements

Leave a comment

Filed under Python, Software Programs

Comment on this

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s