无法在virtualenv中安装psycopg2“错误:stdarg.h:没有这样的文件或目录"

编程入门 行业动态 更新时间:2024-10-25 16:21:06
本文介绍了无法在virtualenv中安装psycopg2“错误:stdarg.h:没有这样的文件或目录"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

注意:使用easy_install和其他安装方式时,也会发生同样的错误...

NOTE: This same error also occurs when using easy_install, other ways of installation...

我面临的问题与我正在尝试将psycopg2安装到Mac OS 10.6.3上;它声称找不到"stdarg.h".但我可以看到它的存在; ,除了我在OSX Lion(10.7)和Python v2.7上.

I'm facing almost exactly the same problem as I'm trying to install psycopg2 onto Mac OS 10.6.3; it claims it can't find "stdarg.h" but I can see it's there; what should I do? , except I'm on OSX Lion (10.7) and I'm on Python v2.7.

它似乎还与无法在Mac OS X 10.7上的virtualenv中使用pip安装psycopg2 ,但是我得到了另一条错误消息.

It's also seemingly related to Can't install psycopg2 with pip in virtualenv on Mac OS X 10.7 but I get a different error message.

我提出了一个新问题,因为适用于OSX 10.6的解决方案(例如 mail.python/pipermail/pythonmac-sig/2009-September/021617.html )对我不起作用.

I made a new question because solutions that worked for OSX 10.6 (such as mail.python/pipermail/pythonmac-sig/2009-September/021617.html) don't work for me.

我正在尝试在Heroku上为Django编写教程( devcenter.heroku. com/articles/django ), 并且尝试安装psycopg2时遇到错误.这是跟踪:

I'm trying to do the tutorial for Django on Heroku (devcenter.heroku/articles/django), and I run into an error trying to install psycopg2. Here's the trace:

Downloading/unpacking psycopg2 Running setup.py egg_info for package psycopg2 no previously-included directories found matching 'doc/src/_build' Installing collected packages: psycopg2 Running setup.py install for psycopg2 building 'psycopg2._psycopg' extension gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.5 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x090005 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I. -I/usr/include -I/usr/include/postgresql/server -c psycopg/psycopgmodule.c -o build/temp.macosx-10.6-intel-2.7/psycopg/psycopgmodule.o In file included from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:4, from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:85, from ./psycopg/psycopg.h:30, from psycopg/psycopgmodule.c:27: /Developer/SDKs/MacOSX10.6.sdk/usr/include/stdarg.h:4:25: error: stdarg.h: No such file or directory In file included from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:4, from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:85, from ./psycopg/psycopg.h:30, from psycopg/psycopgmodule.c:27: /Developer/SDKs/MacOSX10.6.sdk/usr/include/stdarg.h:4:25: error: stdarg.h: No such file or directory lipo: can't figure out the architecture type of: /var/tmp//ccHla8Gp.out error: command 'gcc-4.2' failed with exit status 1 Complete output from command /Users/AndyFang/Desktop/code/venv/bin/python -c "import setuptools;__file__='/Users/AndyFang/Desktop/code/venv/build/psycopg2/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-ONvqYm-record/install-record.txt --install-headers /Users/AndyFang/Desktop/code/venv/bin/../include/site/python2.7: running install running build running build_py running build_ext building 'psycopg2._psycopg' extension gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.5 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x090005 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I. -I/usr/include -I/usr/include/postgresql/server -c psycopg/psycopgmodule.c -o build/temp.macosx-10.6-intel-2.7/psycopg/psycopgmodule.o In file included from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:4, from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:85, from ./psycopg/psycopg.h:30, from psycopg/psycopgmodule.c:27: /Developer/SDKs/MacOSX10.6.sdk/usr/include/stdarg.h:4:25: error: stdarg.h: No such file or directory In file included from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:4, from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:85, from ./psycopg/psycopg.h:30, from psycopg/psycopgmodule.c:27: /Developer/SDKs/MacOSX10.6.sdk/usr/include/stdarg.h:4:25: error: stdarg.h: No such file or directory lipo: can't figure out the architecture type of: /var/tmp//ccHla8Gp.out error: command 'gcc-4.2' failed with exit status 1 ---------------------------------------- Command /Users/AndyFang/Desktop/code/venv/bin/python -c "import setuptools;__file__='/Users/AndyFang/Desktop/code/venv/build/psycopg2/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-ONvqYm-record/install-record.txt --install-headers /Users/AndyFang/Desktop/code/venv/bin/../include/site/python2.7 failed with error code 1 in /Users/AndyFang/Desktop/code/venv/build/psycopg2 Storing complete log in /Users/AndyFang/.pip/pip.log

我不知道为什么找不到stdarg.h!我在网上调查了很多答案,但无济于事.

I don't know why it can't find stdarg.h! I've looked into a lot of answers online, to no avail.

推荐答案

看来您的构建环境已损坏. stdarg.h是核心gcc标头的一部分.在我的(Fedora 16 Linux)系统上,stdarg.h位于/usr/lib/gcc/x86_64-redhat-linux/4.6.2/include/stdarg.h中,并且是gcc软件包的一部分.

It looks like you have a broken build environment. stdarg.h is part of the core gcc headers. On my (Fedora 16 Linux) system stdarg.h is in /usr/lib/gcc/x86_64-redhat-linux/4.6.2/include/stdarg.h and is part of the gcc package.

在Apple平台上,我希望它随XCode一起提供.猜测,您安装了多个编译器/工具链,并且它们的包含路径变得混乱.我建议彻底卸载XCode及其所有朋友,删除相关目录以摆脱混乱,然后重新安装很多.

On Apple platforms I expect it's shipped with XCode. At a guess, you have more than one compiler/toolchain installed, and their include paths are getting muddled. I suggest clean-uninstalling XCode and all its friends, deleting the relevant directories to get rid of stragglers, then reinstalling the lot.

更多推荐

无法在virtualenv中安装psycopg2“错误:stdarg.h:没有这样的文件或目录"

本文发布于:2023-10-18 12:15:58,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1504202.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误   文件   目录   virtualenv   quot

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!