当前位置:  开发笔记 > 编程语言 > 正文

在fedora 23上安装pip install psycopg2时出错

如何解决《在fedora23上安装pipinstallpsycopg2时出错》经验,为你挑选了1个好方法。

我会做一段时间,我正在做这些事情

 ?  ~  cd ~/project

    ?  project  source vProject/bin/activate

    (vProject)?  project  cd edu

    (vProject)?  edu  pip install pillow

    Requirement already satisfied (use --upgrade to upgrade): pillow in /home/hadi/project/vProject/lib/python2.7/site-packages

以及我安装psycopg2的那一刻

(vProject)➜edupip install psycopg2

我收到了这个错误

Collecting psycopg2
      Using cached psycopg2-2.6.1.tar.gz
    Building wheels for collected packages: psycopg2
      Running setup.py bdist_wheel for psycopg2
      Complete output from command /home/hadi/project/vProject/bin/python -c "import setuptools;__file__='/tmp/pip-build-K4RBgE/psycopg2/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmp_YVqgFpip-wheel-:
      running bdist_wheel
      ...

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

      ----------------------------------------
      Failed building wheel for psycopg2
    Failed to build psycopg2
    Installing collected packages: psycopg2
      Running setup.py install for psycopg2
        Complete output from command /home/hadi/project/vProject/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-K4RBgE/psycopg2/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-mKANSq-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/hadi/project/vProject/include/site/python2.7/psycopg2:
        running install
        running build
        running build_py
        running build_ext
        building 'psycopg2._psycopg' extension
        gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.6.1 (dt dec pq3 ext lo64)" -DPG_VERSION_HEX=0x090405 -DHAVE_LO64=1 -I/usr/include/python2.7 -I. -I/usr/include -I/usr/include/pgsql/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-2.7/psycopg/psycopgmodule.o -Wdeclaration-after-statement

        In file included from psycopg/psycopgmodule.c:27:0:

        ./psycopg/psycopg.h:31:22: fatal error: libpq-fe.h: No such file or directory
        compilation terminated.

        error: command 'gcc' failed with exit status 1

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

我以前安装过gcc



1> 小智..:

您缺少一个安装它所需的库.我相信你需要安装的软件包postgresql-devel.

推荐阅读
李桂平2402851397
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有