为了账号安全,请及时绑定邮箱和手机立即绑定

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

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

喵喔喔 2019-06-21 16:47:02
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 psycopg2Downloading/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 psycopg2Installing 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
查看完整描述

3 回答

?
跃然一笑

TA贡献1826条经验 获得超6个赞

通过在编译前设置以下环境变量,您可以告诉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+那里。


查看完整回答
反对 回复 2019-06-21
?
青春有我

TA贡献1784条经验 获得超8个赞

Xcode 5.1

ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install psycopg2


查看完整回答
反对 回复 2019-06-21
  • 3 回答
  • 0 关注
  • 354 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信