Python 使用pip的Psycopg2安装错误

Python 使用pip的Psycopg2安装错误,python,Python,我想安装psycopg2。我正在使用mavericks 10.9.2。我试过了 sudo pip install psycopg2 但我有这样的错误:: clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future] clang: note: this will be a hard error (cannot be downgraded to

我想安装psycopg2。我正在使用mavericks 10.9.2。我试过了

sudo pip install psycopg2
但我有这样的错误::

 clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
    clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
    error: command 'cc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-nLGzhp/psycopg2/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-xFWboX-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-nLGzhp/psycopg2

如何能纠正这个请帮助我!!提前感谢。

OSX Mavericks附带的Xcode版本不允许传递未知参数,这就是为什么会出现此错误

对于需要编译C扩展的其他Python包(不仅仅是psycopg2),也可能发生这种情况

一种解决方法是告诉编译器使用以下环境变量时,其行为与以前类似:

sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install psycopg2
注:这将在现在起作用,但在将来使用此选项可能会被删除