Python3.2 安装 MySQLdb

环境:ubuntu 11.10

说明:ubuntu 11.10 中 自带 python2.7 python3.2是后来自己安装上去的:sudo apt-get install python3

1.需要安装python3 版本的setuptools .旧版的setuptools已经不能用于Python3上了,国外有大神fork出了另一分支distribute,它可以支持Python3
wget http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz

#解压缩 && 安装
tar -xzvf ./distribute-0.6.28.tar.gz
cd distribute-0.6.28/
python3 ./setup.py install
2.从github 上 下载 MySQL-for-Python-3:
 git clone https://github.com/davispuh/MySQL-for-Python-3.git
 cd MySQL-for-Python-3
 sudo python3 setup.py install
3.以上操作,很可能会引发如下错误:
 mysql_config not found ubuntu 安装 mysql 后找不到 mysql_config
 执行:sudo apt-get install libmysqlclient15-dev 然后重复2 的操作
 
posted @ 2013-02-17 16:14  QG.xiaoguang  阅读(552)  评论(0编辑  收藏  举报