python - 错误 : command 'gcc' failed with exit status when installing psycopg2

标签 python gcc centos odoo centos5

我需要为 openerp 安装过程安装 psycopg2,但我总是遇到这个错误。我已经使用过 pipeasy_install 并且我的 gcc 是最新版本。我真的需要你的帮助来解决我的问题。

这是我使用 easy_install 的完整错误:

[root@server01 ~]# easy_install psycopg2    
Searching for psycopg2    
Reading http://pypi.python.org/simple/psycopg2/    
Reading http://initd.org/psycopg/    
Reading http://initd.org/projects/psycopg2    
Best match: psycopg2 2.4.5    
Downloading http://initd.org/psycopg/tarballs/PSYCOPG-2-4/psycopg2-2.4.5.tar.gz    
Processing psycopg2-2.4.5.tar.gz    
Running psycopg2-2.4.5/setup.py -q bdist_egg --dist-dir /tmp/easy_install-anWVvJ/psycopg2-2.4.5/egg-dist-tmp-cZbdtn

no previously-included directories found matching 'doc/src/_build' In file included from psycopg/psycopgmodule.c:27:
./psycopg/psycopg.h:31:22: error: libpq-fe.h: No such file or directory In file included from psycopg/psycopgmodule.c:29:

...

error: Setup script exited with error: command 'gcc' failed with exit status 1

最佳答案

您需要安装 PostgreSQL 的开发包,例如在 Ubuntu 下是 sudo apt-get install libpq-dev... 而对于 CentOS,它是 yum install postgresql -开发

关于python - 错误 : command 'gcc' failed with exit status when installing psycopg2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12911717/

相关文章:

python - 如何保存odoo的配置文件?

c - 与gcc中的共享库链接时如何为可执行文件生成位置相关代码?

python - 返回上个月的日期时间对象

python - 在python中发送串行消息

c - 当我尝试使用指针访问结构时出错

linux - 检查目录是否用 bash 挂载

linux - ssh keygen 权限被拒绝

linux - 使用剧本的 YAML 语法错误 (Ansible)

python - 根据数值有条件创建数据框列

c - gcc 用 .s 文件编译 .c - .bss 混淆(错误?)