简体   繁体   English

无法在 Azure 上安装 psycopg2

[英]Can't Install psycopg2 on Azure

I am creating a pipeline with a python script on Azure Web Service.我正在 Azure Web 服务上使用 python 脚本创建管道。

My script uses psycopg2 to connect to the postgres database我的脚本使用 psycopg2 连接到 postgres 数据库

but I am getting an error trying to import psycopg2 saying但我在尝试导入 psycopg2 时遇到错误说

from psycopg2._psycopg import ( # noqa ImportError: /home/site/wwwroot/antenv/lib/python3.7/site-packages/psycopg2/_psycopg.cpython-37m-x86_64-linux-gnu.so: undefined symbol: PQencryptPasswordConn from psycopg2._psycopg import ( # noqa ImportError: /home/site/wwwroot/antenv/lib/python3.7/site-packages/psycopg2/_psycopg.cpython-37m-x86_64-linux-gnu.so: undefined symbol: PQencryptPasswordConn

any help would be apprciated任何帮助都会得到认可

PQencryptPasswordConn was introduced in PostgreSQL v10. PQencryptPasswordConn是在 PostgreSQL v10 中引入的。 So you must be trying to use psycopg2 with a libpq that is older than that.因此,您必须尝试将 psycopg2 与比它更旧的 libpq 一起使用。

The solution is to upgrade your PostgreSQL client.解决方案是升级您的 PostgreSQL 客户端。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM