問題描述
我需要為 openerp
安裝過程安裝 psycopg2
,但我總是遇到這個錯誤.我已經使用過 pip
和 easy_install
并且我的 gcc
是最新版本.我真的需要你的幫助來解決我的問題.
I need to install psycopg2
for openerp
installation process, but I always faced that error. I've already used pip
and easy_install
and my gcc
is the latest version. I 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"以退出狀態失敗的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!