我几天来一直在网上搜索,但我无法在我的 Linux 机器(CentOS - 2.6.32-431.3.1.el6.x86_64 GNU/Linux)上安装 psycopg2 库。
我知道问题是我缺少 libpq 头文件,因为我在尝试 pip install psycopg2 后收到此消息: libpq-fe.h: No such file or directory
http://initd.org/psycopg/docs/install.html#install-from-source
我发现的几乎所有文章都指出我在 CentOS 上使用 apt-get 但 apt-get 不是 CentOS 6.3 上的标准工具,所以我一直在尝试yum install。
但是,每次我尝试使用sudo yum install下载的东西时,软件包都不可用。例如:
yum install postgresql-devel
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
drivesrvr | 2.2 kB 00:00
No package postgresql-devel available.
Error: Nothing to do
我试过这个: