简体   繁体   English

错误(Mac OS):sudo pip install MySQl-python

[英]Error(Mac OS): sudo pip install MySQl-python

I have problem on command 我的命令有问题

sudo pip install MySQl-python

All log: 所有日志:

  Downloading/unpacking MySQl-python
  Downloading MySQL-python-1.2.5.zip (108kB): 108kB downloaded
  Running setup.py (path:/private/tmp/pip_build_root/MySQl-python/setup.py) egg_info for package MySQl-python

Installing collected packages: MySQl-python
  Running setup.py install for MySQl-python
    building '_mysql' extension
    cc -fno-strict-aliasing -fno-common -dynamic -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 -pipe -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/local/mysql/include -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 -Wno-null-conversion -Os -g -fno-strict-aliasing -arch x86_64
    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
    Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip_build_root/MySQl-python/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-1ySuuV-record/install-record.txt --single-version-externally-managed --compile:
    running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-intel-2.7
copying _mysql_exceptions.py -> build/lib.macosx-10.9-intel-2.7
...
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 -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 -pipe -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/local/mysql/include -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 -Wno-null-conversion -Os -g -fno-strict-aliasing -arch x86_64
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, tokenize;__file__='/private/tmp/pip_build_root/MySQl-python/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-1ySuuV-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/tmp/pip_build_root/MySQl-python
Storing debug log for failure in /Users/Detonavomek/Library/Logs/pip.log

I already download Mysql, Xcode and Command Line Tools. 我已经下载了Mysql,Xcode和命令行工具。 I have another problem with brew(brew link), and I thing that it is linked with this problem. 我有另一个问题brew(brew链接),我认为它与这个问题有关。

From mysql-python on mac os 10.9.1 来自mac os 10.9.1上的mysql-python

Fixed it by running: 通过运行修复它:

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

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

Props to Romeo Mihalcea for answering his own question. 向Romeo Mihalcea道具回答他自己的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM