美文网首页
centos环境的python导入psycopg2

centos环境的python导入psycopg2

作者: DavidOcean | 来源:发表于2020-05-22 21:03 被阅读0次

环境:

centos8

python3.8

需求:

通过pip3导包psycopg2一直失败,一般都提示:Error:pg_config executable not found。 说明客户端的一些的东西没有,那么就需要安装对应的客户端内容等才能够导入成功。

解决办法:

通过yum下载对应的postgresql-devel*的所有环境。 

步骤:

1.通过yum下载所有的postgresql-devel*

yum install postgresql-devel*

2.通过pip3导入psycopg2

pip3 install psycopg2

tips:

如果还失败,在 yum install postgresql-odbc.x86_64来导入odbc包

相关文章

网友评论

      本文标题:centos环境的python导入psycopg2

      本文链接:https://www.haomeiwen.com/subject/tawcahtx.html