错误:安装psycopg2时,命令'gcc'失败,退出状态 [英] error: command 'gcc' failed with exit status when installing psycopg2

查看:2453
本文介绍了错误:安装psycopg2时,命令'gcc'失败,退出状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要安装 psycopg2 openerp 安装过程,但我总是发现错误。我已经使用 pip easy_install ,我的 gcc 是最新版本。真的需要你的帮助来解决我的问题...

i need to install psycopg2 for openerp installation process, but i always found that error. i've already used pip and easy_install, my gcc is the latest version. Really need your help to solve my problem...

这是我的完全错误与easy_install ..

this is my complete error with 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-devel

You'll need to install the development package for PostgreSQL, which for instance under Ubuntu is a sudo apt-get install libpq-dev... and for CentOS it's yum install postgresql-devel

这篇关于错误:安装psycopg2时,命令'gcc'失败,退出状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆