如何在Centos 7中安装psycopg2?

时间:2016-04-20 20:35:50

标签: python django postgresql centos7

我想为postgresql安装django后端。我试过了:

pip install psycopg2

但是,我有以下输出:

 In file included from psycopg/psycopgmodule.c:27:0:
    ./psycopg/psycopg.h:31:22: fatal error: libpq-fe.h: No such file or directory
     #include <libpq-fe.h>
                          ^
    compilation terminated.
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/home/_ws_/rest/gps/venv/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-G252wf/psycopg2/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-CX3AAq-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/_ws_/rest/gps/venv/include/site/python2.7/psycopg2" failed with error code 1 in /tmp/pip-build-G252wf/psycopg2/

我该怎么办?

谢谢!

0 个答案:

没有答案