我的命令有问题
sudo pip install MysqL-python
所有日志:
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,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,'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
解决方法
从
mysql-python on mac os 10.9.1起
通过运行修复它:
export CFLAGS = -Qunused-arguments
export CPPFLAGS = -Qunused-arguments
在`pip install …“之前
向Romeo Mihalcea道具回答他自己的问题.