Import psycopg2 Library not loaded: libssl.1.0.0.dylib

前端 未结 20 2548
囚心锁ツ
囚心锁ツ 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:29

    I am using Mac OS Sierra: and got this error:

     Library not loaded: libssl.1.1.dylib
    

    I found this library in

     /Library/PostgreSQL/11/lib
    

    I found this solution in internet:

     export DYLD_LIBRARY_PATH=/Library/PostgreSQL/11/lib
    

    But this is not a permanent solution. As I have to run the above command whenever I restart my server.

    Add the line: export DYLD_LIBRARY_PATH=/Library/PostgreSQL//lib
    to ~/.bash_profile

提交回复
热议问题