mysql-python无法在OSX 10.9.2上安装

时间:2014-05-29 06:30:03

标签: python mysql

我试过'pip install MySQL-python'

我试过'pip install -Iv http://sourceforge.net/projects/mysql-python/files/mysql-python/1.2.2/MySQL-python-1.2.2.tar.gz/download'

认为旧版本不会出现同样的问题。

我也尝试下载tar文件并运行'python setup.py install'

问题总是一样的......

MySQL-python-1.2.3>  sudo python setup.py install 
Password:
running install
running bdist_egg
running egg_info
writing MySQL_python.egg-info/PKG-INFO
writing top-level names to MySQL_python.egg-info/top_level.txt
writing dependency_links to MySQL_python.egg-info/dependency_links.txt
reading manifest file 'MySQL_python.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'MANIFEST'
warning: no files found matching 'ChangeLog'
warning: no files found matching 'GPL'
writing manifest file 'MySQL_python.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.9-intel/egg    
running install_lib
running build_py
copying MySQLdb/release.py -> build/lib.macosx-10.9-intel-2.7/MySQLdb
running build_ext
building '_mysql' extension
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,3,'final',0) -    D__version__=1.2.3 -I/usr/local/Cellar/mysql/5.6.17_1/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 个答案:

答案 0 :(得分:1)

将我的头撞在墙上,阅读,一点点试验和错误(并告诉我们 - 一点点的哭泣)这对我有用。魔术酱是通过-E标志来获得正确的环境和特权组合。

sudo -E pip install [MODULE]

sudo -E python setup.py install

接下来的问题......