Error: command #39;gcc#39; failed with exit status when installing psycopg2(错误:安装 psycopg2 时命令“gcc以退出状态失败)
问题描述
我需要为 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"以退出状态失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:错误:安装 psycopg2 时命令“gcc"以退出状态失败
基础教程推荐
- 线程时出现 msgbox 错误,GUI 块 2022-01-01
- 如何让 python 脚本监听来自另一个脚本的输入 2022-01-01
- 用于分类数据的跳跃记号标签 2022-01-01
- 筛选NumPy数组 2022-01-01
- 使用PyInstaller后在Windows中打开可执行文件时出错 2022-01-01
- Dask.array.套用_沿_轴:由于额外的元素([1]),使用dask.array的每一行作为另一个函数的输入失败 2022-01-01
- 如何在海运重新绘制中自定义标题和y标签 2022-01-01
- Python kivy 入口点 inflateRest2 无法定位 libpng16-16.dll 2022-01-01
- 何时使用 os.name、sys.platform 或 platform.system? 2022-01-01
- 在 Python 中,如果我在一个“with"中返回.块,文件还会关闭吗? 2022-01-01