在psycopg2中打开postgres连接会导致python崩溃

2024-06-01 06:03:15 发布

您现在位置:Python中文网/ 问答频道 /正文

当我试图打开与postgres数据库的连接时,收到以下错误消息。可能与OpenSSL有关,但我无法理解错误消息。有人能帮忙吗?

>>> import psycopg2
>>> conn = psycopg2.connect(host = '', port = , dbname
 = '', user = '', password = '')
Auto configuration failed
12848:error:02001015:system library:fopen:Is a directory:.\crypto\bio\bss_file.c
:169:fopen('D:/Build/OpenSSL/openssl-1.0.1h-vc9-x64/ssl/openssl.cnf','rb')
12848:error:2006D002:BIO routines:BIO_new_file:system lib:.\crypto\bio\bss_file.
c:174:
12848:error:0E078002:configuration file routines:DEF_LOAD:system lib:.\crypto\co
nf\conf_def.c:199:

Tags: 消息错误errorcryptosystemconfigurationpsycopg2file
1条回答
网友
1楼 · 发布于 2024-06-01 06:03:15

我能想到的一个问题是,您的安装可能没有正确地链接/构建以使用openssl。如果您还没有尝试文档中列出的包,也许您可以尝试一下。在

当我看到docs时:

Microsoft Windows:

Jason Erickson maintains a packaged Windows port of Psycopg with installation executable. Download. Double click. Done.

所以你可以试着从那里安装它。或者你可以尝试pip友好的windows友好软件包(注意:我没有亲自尝试)psycopg2-windows软件包。在

相关问题 更多 >