Chinaunix首页 | 论坛 | 博客
  • 博客访问: 608765
  • 博文数量: 74
  • 博客积分: 1845
  • 博客等级: 上尉
  • 技术积分: 731
  • 用 户 组: 普通用户
  • 注册时间: 2005-03-14 20:49
文章分类

全部博文(74)

文章存档

2017年(3)

2016年(7)

2015年(4)

2014年(6)

2013年(7)

2012年(10)

2011年(10)

2010年(4)

2009年(5)

2008年(4)

2007年(7)

2006年(6)

2005年(1)

分类: LINUX

2009-09-14 15:30:08

 
 

首先需要安装有setuptool,

wget -q 
然后python ez_setup.py
还有确定是否安装了python-devel包

安装包下载

解压后修改site.cfg文件

[options]
# embedded: link against the embedded server library
# threadsafe: use the threadsafe client
# static: link against a static library (probably required for embedded)

embedded = False
threadsafe = True
static = False

# The path to mysql_config.
# Only use this if mysql_config is not on your PATH, or you have some weird
# setup that requires it.

#需要指定mysql安装位置中的配置程序
mysql_config = /usr/local/bin/mysql_config

# The Windows registry key for MySQL.
# This has to be set for Windows builds to work.
# Only change this if you have a different version.
registry_key = SOFTWARE\MySQL AB\MySQL Server 5.0

如果在编译到最后时,报告链接不上libmysqlclient_r.so的话,还需要把threadsafe设置为False。

然后

python setup.py build

python setup.py install

安装完成后

如果在import MySQLdb时出现importError: libmysqlclient_r.so.16: cannot open shared object file: No such file or directory错误

需要export LD_LIBRARY_PATH=/usr/local/mysql/lib:$LD_LIBRARY_PATH

另外如果出现包含解压目录的警告信息的话,需要删除解压目录,即可正常

Posted in .

Leave a Reply

 

还包括了python

呵呵

阅读(1616) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~