mac os的Xcode从5.1起给编译器规定对于未知参数传入视为error,我们需要使用ARCHFLAGS将该error降级为warning,因此最后的安装命令应该如下:

sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future  python setup.py install

如果出错根据mysql的版本不同可以加入

-arch x86或者 -arch x86_64

defaults write com.apple.versioner.python Prefer-32-Bit -bool no

defaults write com.apple.versioner.python Prefer-64-Bit -bool yes

 

http://xuqingkuang.is-programmer.com/2008/9/17/install-mysqldb-into-mac-os-x-for-django.6046.html

 

 

XAMPP for MAC 1.8.1 + MySQLdb 1.2.4 编译需要3个步骤记录下:1. 修改site.cfg 中 mysql_config = /Applications/XAMPP/bin/mysql_config

2.export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/Applications/XAMPP/xamppfiles/lib/

3.下载xampp-devel 修改其中的include目录为xampp目录 include/mysql/

安装lxml也出问题了,原因是版本太高换成低版本就安装成功了
sudo easy_install lxml==2.2.8

 


Avatar photo
Harrie

我是王岩,2010年为了扩展自己的事业,我成立了一家互联网公司:上海岩创网络科技有限公司,2011年加入宏路数据任技术总监,2017年成立动乂岩数据技术有限公司同时兼任动点科技CTO。现在我正在搭建团队,在微信生态和企业服务领域进行探索。我的联系方式是:手机:13918304704 微信: harriewang QQ:13689186 欢迎大家跟我交流和讨论。

所有文章