【问题标题】:mysql-python fails to install on OSX 10.9.2mysql-python 无法在 OSX 10.9.2 上安装
【发布时间】:2014-05-29 06:30:02
【问题描述】:

我已经尝试过'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 

【问题讨论】:

    标签: python mysql


    【解决方案1】:

    在将我的头撞到墙上、阅读、一些尝试和错误(顺便说一句,我们 - 一点点哭泣)之后,这对我有用。神奇的方法是通过 -E 标志来获得环境和特权的正确组合。

    sudo -E pip install [MODULE]
    

    sudo -E python setup.py install
    

    下一个问题……

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-01-14
      • 1970-01-01
      • 2014-04-29
      • 1970-01-01
      • 1970-01-01
      • 2016-09-04
      • 1970-01-01
      相关资源
      最近更新 更多