本文介绍了铛:错误:未知参数:'-mno-fused-madd'[-Wunused命令行参数硬错误在将来]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

尝试在Mavericks操作系统中安装Scrapy时出现以下错误.

I get the following error trying to install Scrapy in a Mavericks OS.

我已经安装了命令行工具和X11,但我真的不知道发生了什么,也没有发现通过Web浏览时出现的相同错误.我认为这可能与Xcode 5.1中的某些更改有关

I have command line tools and X11 installed I don't really know whats going on and I haven`t found the same error browsing through the Web. I think it might be related to some change in Xcode 5.1

感谢您的回答!

这是命令输出的一部分:

this is part of the command output:

$ pip安装scrapy

$pip install scrapy

.
.
.
.

Downloading/unpacking cryptography>=0.2.1 (from pyOpenSSL->scrapy)
  Downloading cryptography-0.3.tar.gz (208kB): 208kB downloaded
  Running setup.py egg_info for package cryptography
    OS/X: confusion between 'cc' versus 'gcc' (see issue 123)
    will not use '__thread' in the C code
    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
    Traceback (most recent call last):
      File "<string>", line 16, in <module>
      File "/Users/agonzamart/.virtualenvs/Parser/build/cryptography/setup.py", line 156, in <module>
        "test": PyTest,
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 112, in setup
        _setup_distribution = dist = klass(attrs)
      File "/Users/agonzamart/.virtualenvs/Parser/lib/python2.7/site-packages/setuptools/dist.py", line 265, in __init__
        self.fetch_build_eggs(attrs.pop('setup_requires'))
      File "/Users/agonzamart/.virtualenvs/Parser/lib/python2.7/site-packages/setuptools/dist.py", line 289, in fetch_build_eggs
        parse_requirements(requires), installer=self.fetch_build_egg
      File "/Users/agonzamart/.virtualenvs/Parser/lib/python2.7/site-packages/pkg_resources.py", line 618, in resolve
        dist = best[req.key] = env.best_match(req, self, installer)
      File "/Users/agonzamart/.virtualenvs/Parser/lib/python2.7/site-packages/pkg_resources.py", line 862, in best_match
        return self.obtain(req, installer) # try and download/install
      File "/Users/agonzamart/.virtualenvs/Parser/lib/python2.7/site-packages/pkg_resources.py", line 874, in obtain
        return installer(requirement)
      File "/Users/agonzamart/.virtualenvs/Parser/lib/python2.7/site-packages/setuptools/dist.py", line 339, in fetch_build_egg
        return cmd.easy_install(req)
      File "/Users/agonzamart/.virtualenvs/Parser/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 623, in easy_install
        return self.install_item(spec, dist.location, tmpdir, deps)
      File "/Users/agonzamart/.virtualenvs/Parser/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 653, in install_item
        dists = self.install_eggs(spec, download, tmpdir)
      File "/Users/agonzamart/.virtualenvs/Parser/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 849, in install_eggs
        return self.build_and_install(setup_script, setup_base)
      File "/Users/agonzamart/.virtualenvs/Parser/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1130, in build_and_install
        self.run_setup(setup_script, setup_base, args)
      File "/Users/agonzamart/.virtualenvs/Parser/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1118, in run_setup
        raise DistutilsError("Setup script exited with %s" % (v.args[0],))
    distutils.errors.DistutilsError: Setup script exited with error: command 'cc' failed with exit status 1
    Complete output from command python setup.py egg_info:
    OS/X: confusion between 'cc' versus 'gcc' (see issue 123)

will not use '__thread' in the C code

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

Traceback (most recent call last):

  File "<string>", line 16, in <module>

  File "/Users/agonzamart/.virtualenvs/Parser/build/cryptography/setup.py", line 156, in <module>

    "test": PyTest,

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 112, in setup

    _setup_distribution = dist = klass(attrs)

  File "/Users/agonzamart/.virtualenvs/Parser/lib/python2.7/site-packages/setuptools/dist.py", line 265, in __init__

    self.fetch_build_eggs(attrs.pop('setup_requires'))

  File "/Users/agonzamart/.virtualenvs/Parser/lib/python2.7/site-packages/setuptools/dist.py", line 289, in fetch_build_eggs

    parse_requirements(requires), installer=self.fetch_build_egg

  File "/Users/agonzamart/.virtualenvs/Parser/lib/python2.7/site-packages/pkg_resources.py", line 618, in resolve

    dist = best[req.key] = env.best_match(req, self, installer)

  File "/Users/agonzamart/.virtualenvs/Parser/lib/python2.7/site-packages/pkg_resources.py", line 862, in best_match

    return self.obtain(req, installer) # try and download/install

  File "/Users/agonzamart/.virtualenvs/Parser/lib/python2.7/site-packages/pkg_resources.py", line 874, in obtain

    return installer(requirement)

  File "/Users/agonzamart/.virtualenvs/Parser/lib/python2.7/site-packages/setuptools/dist.py", line 339, in fetch_build_egg

    return cmd.easy_install(req)

  File "/Users/agonzamart/.virtualenvs/Parser/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 623, in easy_install

    return self.install_item(spec, dist.location, tmpdir, deps)

  File "/Users/agonzamart/.virtualenvs/Parser/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 653, in install_item

    dists = self.install_eggs(spec, download, tmpdir)

  File "/Users/agonzamart/.virtualenvs/Parser/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 849, in install_eggs

    return self.build_and_install(setup_script, setup_base)

  File "/Users/agonzamart/.virtualenvs/Parser/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1130, in build_and_install

    self.run_setup(setup_script, setup_base, args)

  File "/Users/agonzamart/.virtualenvs/Parser/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1118, in run_setup

    raise DistutilsError("Setup script exited with %s" % (v.args[0],))

distutils.errors.DistutilsError: Setup script exited with error: command 'cc' failed with exit status 1

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /Users/agonzamart/.virtualenvs/Parser/build/cryptography


推荐答案

这是由于Xcode 5.1clang默认值的更改而引起的,并且Apple没有注意到它将破坏使用系统Python的扩展模块的构建.一种解决方法是先定义以下环境变量:

It is due to a change in clang defaults in Xcode 5.1 and Apple not noticing that it would break extension module builds using the system Python. One workaround is to define the following environment variables first:

export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments

更新[2014-05-16]:正如预期的那样,Apple已使用OS X 10.9.3中更新的系统Python(2.7、2.6和2.5)修复了此问题,因此在使用最新的Mavericks和Xcode 5.1+.但是,到目前为止,如果您在此使用Xcode 5.1+,则OS X 10.8.x(Mountain Lion,当前为10.8.5)仍需要解决方法.

UPDATE [2014-05-16]: As expected, Apple has fixed this problem with updated system Pythons (2.7, 2.6, and 2.5) in OS X 10.9.3 so the workaround is no longer necessary when using the latest Mavericks and Xcode 5.1+. However, as of now, the workaround is still required for OS X 10.8.x (Mountain Lion, currently 10.8.5) if you are using Xcode 5.1+ there.

这篇关于铛:错误:未知参数:'-mno-fused-madd'[-Wunused命令行参数硬错误在将来]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 09:25