帮助在雪豹上安装 psycopg2 :命令 '/usr/bin/gcc-4.0'失败,退出状态为 1
这两天已经让我发疯了。
我一直在尝试使用 easy_install 安装 psycopg2,无论我尝试什么(即使用 gcc-4.0 而不是雪豹默认的),我总是得到相同的错误:
错误:安装脚本退出时出现错误:命令'/usr/bin /gcc-4.0' 失败,退出状态 1
请参阅:http://dpaste.com/hold/228252/
我已经用谷歌搜索了这个错误很多次,但我发现没有任何帮助。
This has been driving me crazy for 2 days.
I have been trying to install psycopg2 using easy_install and no matter what I try (i.e using gcc-4.0 instead of the snow leopard default one) I always get the same error:
error: Setup script exited with error: command '/usr/bin/gcc-4.0' failed with exit status 1
Please see: http://dpaste.com/hold/228252/
I have googled that error so many times and nothing I have found seem to help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
看起来您缺少一个依赖项,即
libpq
的开发文件。相关日志部分在这里:尝试安装 libpq 开发文件,然后重新运行 easy_install。你可能会遇到另一个缺失的依赖项;注意 GCC 吐出的第一个错误。
Looks like you're missing a dependency, the development files for
libpq
. The relevant log part is here:Try installing libpq development files and then rerun easy_install. You may hit another missing dependency; pay attention to the first error that GCC spits out.
链接 http://dpaste.com/hold/228252/ 似乎已死,这就是我的方式解决了这个问题(Mac OS X 10.6,virtualenv)。
如果 pip 失败并显示此消息,只需查看虚拟环境中的构建文件夹即可。您应该在那里编辑 setup.cfg 文件,特别是 include_dirs 和 library_dirs。在第一个设置中,我的选项是:
include_dirs=/opt/local/include/postgresql84:/opt/local/include/postgresql84/server
,很可能您需要将library_dirs设置为正确的位置:
library_dirs=/opt/local/lib/postgresql84。
Link http://dpaste.com/hold/228252/ seems to be dead, this is how I solved this problem (Mac OS X 10.6, virtualenv).
If pip fails with this message, just take a look to build folder in your virtual environment. You should edit setup.cfg file there, particularly include_dirs and library_dirs. In first one set your include folders, my option was:
include_dirs=/opt/local/include/postgresql84:/opt/local/include/postgresql84/server
and most likely you will need to set library_dirs to correct location as well:
library_dirs=/opt/local/lib/postgresql84.
可能你应该先安装 postgresql-devel
yum -y 安装 postgresql-devel
probably you should install postgresql-devel first
yum -y install postgresql-devel