2014-03-13 58 views
2

我似乎無法在10.9.1上安裝mysql-python。我懷疑它與最新的命令行工具更新有關,但我不是專家:在mac os上的mysql-python 10.9.1

Running MySQL-python-1.2.5/setup.py -q bdist_egg --dist-dir /var/folders/s7/j138zlt172nf6qqpn98rhzhm0000gn/T/easy_install-kq86vo/MySQL-python-1.2.5/egg-dist-tmp-edndmM 
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: Setup script exited with error: command 'cc' failed with exit status 1 

任何想法如何克服這一點?

與pip同樣錯誤。

回答

4

運行固定它:

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

之前`PIP安裝...```

+0

介意解釋它爲什麼可行? – trigoman

+0

我不知道。我不記得我在哪裏找到它,但它看起來像設置編譯器的ENV不抱怨太多未使用的參數。 –

6

我只是想提高你的答案,這讓我也:

在MacShell上執行以下操作:

sudo su 
export CFLAGS=-Qunused-arguments 
export CPPFLAGS=-Qunused-arguments 
pip install MySQL-python 

否則這些Op tions不會被使用。

乾杯!

+0

不知道爲什麼,但接受的答案不適合我。這一個工作的權利蝙蝠,所以我猜出口沒有爲sudo用戶工作? –

+0

@Hal這是真的。導出是在usercontext中進行的。它們在rootcontext中無效。所以你必須在切換到root後執行它們。 – Andi