2014-03-13 89 views
23

所以,我在這裏發現了一些其他的鏗鏘錯誤,看起來有點類似,但是,修復不適用於我情況。Ansible Installation -clang:error:unknown argument:'-mno-fused-madd'

我正在使用OSX Mavericks,我們正在嘗試安裝Ansible。 我得到了點正確安裝,但是當我嘗試安裝Ansible時,我得到這個鐺錯誤。 我們首先想到它可能是一個版本問題,所以我在gcc49發生這個錯誤後重新安裝了gcc46,但是我仍然收到錯誤。

有誰知道如何解決這個問題?從pip.log日誌文件

我的完整的錯誤報告如下:

cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -Wall -Wstrict-prototypes -Wshorten-64-to-32 -fwrapv -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/MD2.c -o build/temp.macosx-10.9-intel-2.7/src/MD2.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 

---------------------------------------- 
Cleaning up... 
    Removing temporary dir /private/tmp/pip_build_root... 
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip_build_root/pycrypto/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-_7evji-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/tmp/pip_build_root/pycrypto 
Exception information: 
Traceback (most recent call last): 
    File "/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg/pip/basecommand.py", line 122, in main 
    status = self.run(options, args) 
    File "/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg/pip/commands/install.py", line 283, in run 
    requirement_set.install(install_options, global_options, root=options.root_path) 
    File "/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg/pip/req.py", line 1435, in install 
    requirement.install(install_options, global_options, *args, **kwargs) 
    File "/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg/pip/req.py", line 706, in install 
    cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False) 
    File "/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg/pip/util.py", line 697, in call_subprocess 
    % (command_desc, proc.returncode, cwd)) 
InstallationError: Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip_build_root/pycrypto/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-_7evji-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/tmp/pip_build_root/pycrypto 

由於任何人誰可以幫助我與此有關。我們花了幾個小時試圖安裝它,並開始變得相當沮喪。

+0

我使用 「GIT中克隆」 安裝ansible在OSX小牛,如在http://docs.ansible.com/intro_installation.html描述#從源代碼運行,它像一個魅力。你能告訴你如何安裝它? –

+0

我已經嘗試了兩種方法。我試過克隆Ansible repo,並從那裏運行它,以及用pip安裝它。問題是Ansible需要paramiko,PyYAML,jinja2和httplib2。當嘗試安裝這些軟件包時(再次使用pip),我會得到完全相同的錯誤。 – CreationTribe

+0

它不合格。它的小牛蟒。這裏是一個答案:http://stackoverflow.com/a/20295014/16998 – jrwren

回答

67

最近遇到同樣的問題,試圖安裝不同的包。

設置以下的環境變量與PIP安裝之前解決我這個問題:

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

如果你通過sudo安裝時,不要忘記使用「命令-E」,使您的環境變量通過sudo傳播。

如果不爲你工作,請嘗試以下命令:

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

此外,作爲另一種可能的解決方案,你可以嘗試重新編譯使用Python的家釀的新版本。

查看this question瞭解更多信息。

希望這會有所幫助!

+0

不幸的是這些都沒有幫助。但是,你提供的鏈接已經推動我朝着正確的方向發展。我認爲我最終不得不做的是完全刪除pip和python,然後用brew重新安裝python。如果有效,我會通知你。由於大部分內容都在鏈接中 - 如果你願意的話 - 你可以改變你的答案,以適應我最終做的事情,我會檢查你的答案是否正確。感謝您的幫助:) – CreationTribe

+0

@CreationTribe,沒問題。仍然得到相同的錯誤吧?希望新鮮的python安裝程序能爲你做到。我做了一個小小的編輯,但不用擔心 - 如果你解決它,你可能更有意義地在單獨的答案中寫出對你有用的東西,並將其標記爲正確。祝你好運! – tino

+0

這導致我在導出列出的前兩個值後運行「pip install reportlab」。我通過Homebrew安裝了python,並通過Pip安裝了Virtualenv。謝謝! – shawnr

6

對於初學者,誰讀,並試圖answer以上,但還是失敗了(我):

sudo su - export CFLAGS=-Qunused-arguments export CPPFLAGS=-Qunused-arguments pip install ansible exit

你需要運行這些命令export以根用戶身份。之前的回答清楚地說明了這一點,但實際上它並不意味着我作爲終端新手。 sudo su -所做的基本上是切換到root用戶。然後你鍵入的任何命令都以root身份執行,並且這個東西可以工作。

這讓我終於讓Ansible在OSX 10.9.2上運行了很多頭部撞擊之後。

解參考:https://github.com/ansible/ansible/issues/7146#issuecomment-41239561

3
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future cc ..... 

export ARCHFLAGS="-Wno-error=unused-command-line-argument-hard-error-in-future"