(诊断)No module named MySQLdb

启动Keystone同步数据库时提示:

2015-04-16 10:53:24.010 5747 TRACE keystone   File "/usr/local/python2.7/lib/python2.7/site-packages/sqlalchemy/connectors/mysqldb.py", line 64, in dbapi
2015-04-16 10:53:24.010 5747 TRACE keystone     return __import__('MySQLdb')
2015-04-16 10:53:24.010 5747 TRACE keystone ImportError: No module named MySQLdb
2015-04-16 10:53:24.010 5747 TRACE keystone

要安装下面的软件解决:

# pip install mysql-python

 如果安装mysql-python时出现错误:“mysql_config not foud”,可以通过:

# apt-get install libmysqld-dev libmysqlclient-dev

来解决。

 

如果上面的方案都没有解决,
  进入页面https://pypi.python.org/pypi/MySQL-python,下载最新版本的MySQL-python源码,在机器上面安装。

 

posted @ 2015-04-16 11:01  王智愚  阅读(719)  评论(0编辑  收藏  举报