python 安装MySQLdb

(1)pyhton shell下导入MySQLdb失败。

(2)下载解压MySQL-python。

http://pypi.python.org/pypi/MySQL-python/#downloads

(3)下载安装setuptools。

 
(4)build mysqldb成功。
 
(5)安装 mysqldb成功
 
 

 注:如果碰到import error: libmysqlclient.so.18: cannot open shared object file: No such file or directory

     解决方法: locate or find libmysqlclient.so.18

     link path/libmysqlclient.so.18 /usr/lib/

     vi /etc/ld.so.conf    //加入libmysqlclient.so.18 所在的目录

     插入: /usr/lib/

     保存退出后执行/sbin/ldconfig生效

 

http://blog.chinaunix.net/uid-8487640-id-3183185.html

posted @ 2013-06-03 15:00  klj123wan  阅读(244)  评论(0编辑  收藏  举报