[Linux] [Python] [psycopg2]离线安装问题
1.安装psycopg2需要安装依赖
本案例的操作系统为linux red hat
在安装python依赖包psycopg之前,你必须需要先安装postgresql数据库的相关组件:
postgresql-devel,postgresql,postgresql-libs这三个组件比较重要。另外,可选组件:postgresql-server
1.安装上述组件之前,可以用命令来查看你的系统现在是否已经安装了相关组件:
[root@dthost27 ~]# rpm -qa | grep postgresql
没有安装则需要安装如下依赖
- postgresql-libs
- postgresql
- postgresql-devel
2.下载依赖地址:
- https://centos.pkgs.org/7/centos-x86_64/postgresql-libs-9.2.24-1.el7_5.x86_64.rpm.html
- https://pkgs.org/download/Postgresql
- https://pkgs.org/download/postgresql-devel
3.安装依赖
rpm -ivh postgresql-libs-9.2.24-1.el7_5.x86_64.rpm
rpm -ivh postgresql-devel-9.2.24-1.el7_5.x86_64.rpm
rpm -ivh postgresql-9.2.24-1.el7_5.x86_64.rpm