1.  首页
  2.  博客
  3. install MySQL-python on Mac OS

install MySQL-python on Mac OS


安装 MySQL-python 不是很困难。但是今天还是折腾了一个多小时。汗!!!

首先,安装 mysql 我的方法很简单:

sudo brew install mysql

下载 MySQL-python 并且安装:

wget http://downloads.sourceforge.net/project/mysql-python/mysql-python/1.2.3/MySQL-python-1.2.3.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fmysql-python%2F&ts;=1304231897&use;_mirror=cdnetworks-kr-1
tar xzvf MySQL-python-1.2.3.tar.gz
cd MySQL-python
sudo python setup.py build
sudo python setup.py install

很简单把。可是问题来了居然报错

lipo: can't open input file: /var/tmp//ccH7MvyK.out (No such file or directory)
error: command 'gcc-4.2' failed with exit status 1

起初以为是 GCC的版本问题。降级了版本错误还是一样。改 site.cfg配置 结果还是一样。晕了!!!

尝试了各种方法。结果是 架构问题

sudo ARCHFLAGS='-arch x86_64' python setup.py build
sudo ARCHFLAGS='-arch x86_64' python setup.py install

这样居然就过去了。。。。郁闷

最后参考文档http://cd34.com/blog/programming/python/mysql-python-and-snow- leopard/

评论 0