Psycopg2 image not found

后端 未结 20 1739
无人及你
无人及你 2020-11-29 18:04

Trying to setup postgres with the postgres mac app and hit this error, which I haven\'t been able to solve. Any thoughts?

    ImportError: dlopen(/Users/Crai         


        
20条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-29 18:28

    This problem cost me the whole morning to solve. I found the discussion on http://initd.org/psycopg/articles/2010/11/11/links-about-building-psycopg-mac-os-x/ really helpful. Thanks to Jurie's answer, the solution to my problem (in Mac) is as below:

    1. Install openssl 1.0.0 using brew:

       brew install openssl
      
    2. using the following command:

      export DYLD_LIBRARY_PATH=/usr/local/Cellar/openssl/**1.0.1x**/lib
      

      replace 1.0.1x part with your current version. For me it is 1.0.1h.

    Hope this helps!

    EDIT: After one day, I found that the second command has to be entered every time when needing to connect to database, so not a permanent solution to this problem.

提交回复
热议问题