我正在尝试在Mac OS 10.6.3上安装psycopg2;它声称找不到“ stdarg.h”。但我可以看到它在那里;我该怎么办? [英] 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?

查看:73
本文介绍了我正在尝试在Mac OS 10.6.3上安装psycopg2;它声称找不到“ stdarg.h”。但我可以看到它在那里;我该怎么办?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正拼命尝试成功安装psycopg2,但一直遇到错误。最新的一个似乎与找不到 stdarg.h有关(请参见下面的代码)。但是我亲眼看到在/Developer/SDKs/MacOSX10.4u.sdk/usr/include/stdarg.h(它声称找不到任何东西)中存在一个名为stdarg.h的文件,所以我已经不知道该怎么办。

I'm desperately trying to successfully install psycopg2 but keep running into errors. The latest one seems to involve it not being to find "stdarg.h" (see code below). However I can see with my own eyes that a file called stdarg.h exists at /Developer/SDKs/MacOSX10.4u.sdk/usr/include/stdarg.h (where it claims it can't find anything) so I've no idea what to do about it.

我正在运行Mac OS 10.6.3,并且在最近几天内,我确保我拥有所有最新的OS开发人员工具。

I'm running Mac OS 10.6.3 and within the last few days I've made sure I have all the latest OS developer tools.

如果有任何区别,我有Python 2.6.2和PostgreSQL 8.4。

I have Python 2.6.2 and PostgreSQL 8.4 if that makes any difference.

python setup.py install    
running install
running build
running build_py
running build_ext
building 'psycopg2._psycopg' extension
creating build/temp.macosx-10.3-fat-2.6
creating build/temp.macosx-10.3-fat-2.6/psycopg
gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.2.1 (dt dec ext pq3)" -DPG_VERSION_HEX=0x080404 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -DHAVE_PQPROTOCOL3=1 -I/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -I. -I/opt/local/include/postgresql84 -I/opt/local/include/postgresql84/server -c psycopg/psycopgmodule.c -o build/temp.macosx-10.3-fat-2.6/psycopg/psycopgmodule.o
In file included from /Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/unicodeobject.h:4,
             from /Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h:85,
             from psycopg/psycopgmodule.c:27:
/Developer/SDKs/MacOSX10.4u.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.6/include/python2.6/unicodeobject.h:4,
             from /Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h:85,
             from psycopg/psycopgmodule.c:27:
/Developer/SDKs/MacOSX10.4u.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/folders/MQ/MQ-tWOWWG+izzuZCrAJpzk+++TI/-Tmp-//ccakFhRS.out
error: command 'gcc' failed with exit status 


推荐答案

以下对我有用:


  1. $ mkvirtualenv --no-site-packages --distribute psycopg2_test

  2. $ cd $ VIRTUAL_ENV

  3. $ pip install psycopg2

  1. $ mkvirtualenv --no-site-packages --distribute psycopg2_test
  2. $ cd $VIRTUAL_ENV
  3. $ pip install psycopg2



笔记




  • 我通过 MacPorts

  • 上面的命令使用了:

    Notes

    • I installed my base Python via MacPorts.
    • The above commands make use of:

      • pip
      • virtualenvwrapper
      • virtualenv

      I bootstrapp ed pip 通过以下方式:

      I bootstrapped pip via the following:


      1. wget http: //python-distribute.org/distribute_setup.py

      2. python distribution_setup.py

      3. easy_install pip

      1. wget http://python-distribute.org/distribute_setup.py
      2. python distribute_setup.py
      3. easy_install pip


    • 更新:我知道这似乎很ving牛,但是学习如何使用 virtualenv 和朋友是一笔可观的前期投资很快,特别是在处理具有很多依赖项的项目时。

      UPDATE: I realize it seems like a lot of yak shaving, but learning how to use virtualenv and friends is an up-front investment that pays off pretty quickly, especially when dealing with projects that have a lot of dependencies.

      这篇关于我正在尝试在Mac OS 10.6.3上安装psycopg2;它声称找不到“ stdarg.h”。但我可以看到它在那里;我该怎么办?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆