【问题标题】:mysql-python on mac os 10.9.1mac os 10.9.1 上的 mysql-python
【发布时间】:2014-04-18 23:40:03
【问题描述】:

我似乎无法在 10.9.1 上安装 mysql-python。我怀疑这与最新的命令行工具更新有关,但我不是专家:

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 也出现同样的错误。

【问题讨论】:

    标签: compiler-construction pip mysql-python easy-install


    【解决方案1】:

    我只是想改进你的答案,这对我也有帮助:

    在 MacShell 上执行以下操作:

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

    否则这些选项将不会被使用。

    干杯!

    【讨论】:

    • 不知道为什么,但接受的答案对我不起作用。这个可以立即使用,所以我猜导出对 sudo 用户不起作用?
    • @Hal 是的。导出是在用户上下文中进行的。它们在根上下文中无效。所以你必须在切换到 root 后执行它们。
    【解决方案2】:

    通过运行修复它:

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

    在`pip install之前...```

    【讨论】:

    • 我不知道。我不记得在哪里找到它了,但它看起来像是为编译器设置 ENV,以免对未使用的参数抱怨太多。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-04-05
    • 1970-01-01
    • 1970-01-01
    • 2011-07-27
    • 2013-04-17
    • 2014-03-23
    相关资源
    最近更新 更多