Psycopg2 Python SSL Support is not compiled in

前端 未结 7 1948
梦毁少年i
梦毁少年i 2020-12-16 13:38

I am trying to connect to my postgres database using psycopg2 with sslmode=\'required\' param; however, I get the following error

psycopg2.OperationalError:          


        
7条回答
  •  爱一瞬间的悲伤
    2020-12-16 13:45

    If you're using v2.6.1 or v2.6.2 of psycopg2 (like me), the answer was a simple upgrade to v2.7. Reading the release notes for psycopg2, there was a minor fix for SSL albeit it doesn't look particularly relevant.

    My setup was as follows:

    • Mac OS X El Capitan 10.11.6
    • psycopg2 2.6.2 installed via pip
    • PostgreSQL installed via Enterprise DB Installer

    Running pip uninstall psycopg2 followed by pip install psycopg2 resolved matters.

提交回复
热议问题