错误:安装 psycopg2 时命令“gcc"以退出状态失败
- 作者: 积月累
- 来源: 51数据库
- 2023-01-12
问题描述
我需要为 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
推荐阅读
热点文章
Discord.py(重写)on_member_update 无法正常工作
0
Discord.py 在 vc 中获取用户分钟数
0
discord.py 重写 |为我的命令出错
0
Discord.py rewrite 如何 DM 命令?
0
播放音频时,最后一部分被切断.如何解决这个问题?(discord.py)
0
在消息删除消息 Discord.py
0
如何使 discord.py 机器人私人/直接消息不是作者的人?
0
(Discord.py) 如何获取整个嵌入内容?
0
Discord bot 尽管获得了许可,但不能提及所有人
0
Discord.py discord.NotFound 异常
0
