Import psycopg2 Library not loaded: libssl.1.0.0.dylib

前端 未结 20 2573
囚心锁ツ
囚心锁ツ 2020-11-28 21:02

When I try to run the command:

import psycopg2

I get the error:

ImportError: dlopen(/Users/gwulfs/anaconda/lib/python2.7/si         


        
20条回答
  •  广开言路
    2020-11-28 21:42

    After trying for more than a day I came to the below solution.

    • brew reinstall openssl@1.0
    • disable csrutil -> google it how to disable it, so that we could copy something
      to /usr/lib
    • copy libssl.1.0.0.dylib to /usr/lib I did- sudo cp /usr/local/Cellar/openssl/1.0.2s/lib/libssl.1.0.0.dylib /usr/lib
    • copy libcrypto.1.0.0.dylib to /usr/lib I did- sudo cp /usr/local/Cellar/openssl/1.0.2s/lib/libcrypto.1.0.0.dylib /usr/lib

    Similarly, if you face issue for Library not loaded: libssl.1.0.0.dylib just change the version from 1.0 to 1.1 of openssl and copy libssl.1.1 instead libssl.1.0 and libcrypto.1.1 instead libcrypto.1.0.0

    Done you are all set to enjoy psycopg2 in mac.

提交回复
热议问题