在Mac osx v10.9上安装mysql-python
2014-04-15 20:54
260 查看
想在新买的Mac机上安装mysql-python驱动,遇到了一大堆的麻烦,最后终于通过万能的谷歌找到最终解决方案。
现象:sudo pip install mysql-python 遇到各种问题
building '_mysql' extension
creating build/temp.macosx-10.9-intel-2.6
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/Applications/mysql/include -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c _mysql.c -o build/temp.macosx-10.9-intel-2.6/_mysql.o
-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
原因出在最新的Xcode5.1,编译工具太新了。
所以在pip时要添加一条信息:ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future
sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install mysql-python
最后成功安装。
这对于PostgreSQL驱动的安装或许也有效。
现象:sudo pip install mysql-python 遇到各种问题
building '_mysql' extension
creating build/temp.macosx-10.9-intel-2.6
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/Applications/mysql/include -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c _mysql.c -o build/temp.macosx-10.9-intel-2.6/_mysql.o
-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
原因出在最新的Xcode5.1,编译工具太新了。
所以在pip时要添加一条信息:ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future
sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install mysql-python
最后成功安装。
这对于PostgreSQL驱动的安装或许也有效。
相关文章推荐
- MAC os10.9 MySql-python 安装
- mac osx安装mysql mysql-python折腾记
- Mac OSX 10.9安装python Pillow
- win10 python3.5安装mysql的API
- python安装mysql-connector-python
- python2.7安装mysql驱动
- ubuntu 安装python mysql模块
- 不用pip安装mysql-connector-python:从github上边下载安装
- win7 64下安装mysql-python报错的解决办法
- centos6 下安装MySQL-python
- Windows下mysql-python安装步骤及常见问题
- MySQLdb/MySQL-python的安装
- 关于Windows系统virtualenv环境安装MySQL-Python的解决方案
- centos7 python3.5安装mysqlclient1.3.9
- windows下安装django(python2.7)并配置mysql
- python3.5 pip安装mysql-python报错解决方法
- yum安装memcache,mongo扩展以及python的mysql模块安装
- mysql-python安装 的问题
- 安装mysql-python时,报错 Python version 2.7 required, which was not found in the registry.