【问题标题】:Unable to install MySQL-Python Mac Mavericks无法安装 MySQL-Python Mac Mavericks
【发布时间】:2014-04-29 11:18:52
【问题描述】:

我无法使用 sudo pip install MySQL-Python 在 Mavericks 上安装 MySQL-Python

我做到了 export CPPFLAGS=-Qunused-argumentsexport CFLAGS=-Qunused-arguments 在运行命令之前,但我仍然遇到了同样的错误。

copying MySQLdb/constants/REFRESH.py -> build/lib.macosx-10.9-intel-2.7/MySQLdb/constants

copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.9-intel-2.7/MySQLdb/constants

running build_ext

building '_mysql' extension

creating build/temp.macosx-10.9-intel-2.7

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 -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/local/Cellar/mysql/5.6.15/include/mysql -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.9-intel-2.7/_mysql.o -Os -g -fno-strict-aliasing

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...
Command /usr/bin/python -c "import setuptools;__file__='/private/tmp/pip-build-root/mysql-python/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-_UV3aF-record/install-record.txt --single-version-externally-managed failed with error code 1 in /private/tmp/pip-build-root/mysql-python

【问题讨论】:

    标签: python mysql macos flask


    【解决方案1】:

    pip install...之前运行以下代码

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

    【讨论】:

    • 我做了这两个,但仍然有同样的问题。
    【解决方案2】:

    好的,这就是我所做的: sudo CFLAGS=-Qunused-arguments CPPFLAGS=-Qunused-arguments python setup.py build 然后同样的事情,但“安装”而不是构建

    【讨论】:

      猜你喜欢
      • 2014-04-20
      • 1970-01-01
      • 2014-04-19
      • 2014-03-20
      • 1970-01-01
      • 1970-01-01
      • 2014-04-02
      • 2013-11-12
      • 2016-11-27
      相关资源
      最近更新 更多