clang错误:未知参数:‘-MnO-联-MADD’(python包安装失败)

clang错误:未知参数:‘-MnO-联-MADD’(python包安装失败)

在尝试安装时,我会得到以下错误psycopg2通过小牛队的点击率10.9:


clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]

不知道如何继续,并在这里和其他地方搜索这个特定的错误。任何帮助都是非常感谢的!


以下是PIP的完整输出:


$ pip install psycopg2

Downloading/unpacking psycopg2

  Downloading psycopg2-2.5.2.tar.gz (685kB): 685kB downloaded

  Running setup.py (path:/private/var/folders/0z/ljjwsjmn4v9_zwm81vhxj69m0000gn/T/pip_build_tino/psycopg2/setup.py) egg_info for package psycopg2


Installing collected packages: psycopg2

  Running setup.py install for psycopg2

    building 'psycopg2._psycopg' extension

    cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.5.2 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x090303 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I. -I/usr/local/Cellar/postgresql/9.3.3/include -I/usr/local/Cellar/postgresql/9.3.3/include/server -c psycopg/psycopgmodule.c -o build/temp.macosx-10.9-intel-2.7/psycopg/psycopgmodule.o

    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




喵喔喔
浏览 355回答 3
3回答

跃然一笑

通过在编译前设置以下环境变量,您可以告诉clang不要将其作为错误引发:export CFLAGS=-Qunused-arguments export CPPFLAGS=-Qunused-arguments然后pip install psycopg2应该行得通。我试着做同样的事pip install lxml.编辑:如果您是作为超级用户安装(如果您试图添加到/Library/Python/2.7/site-packages,随OS X附带的本地Apple工厂安装的Python发行版,而不是随后自己安装的其他Python发行版,然后您需要这样做,如@Thijs Kuipers在下面的评论中所描述的那样:sudo -E pip install psycopg2或等效的名称,以替代您可能要替换的任何其他包名。psycopg2.更新[2014-05-16]:Apple通过更新系统Pythons(2.7、2.6和2.5)解决了这个问题OS X 10.9.3所以当使用最新的小牛和Xcode 5.1+..然而,到目前为止,解决方案仍然需要OS X 10.8.x(山狮,目前为10.8.5)如果你正在使用Xcode 5.1+那里。

青春有我

Xcode 5.1ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install psycopg2
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python