Error loading MySQLdb module: No module named MySQLdb

asked 2012-02-28 03:40:08 -0600

tungns-inf gravatar image

I am trying to install Dashboard following this guide ( . When I sync database, I had this error:

tools/ openstack-dashboard/ syncdb

File "/home/user1/horizon/.venv/local/lib/python2.7/site-packages/django/db/backends/mysql/", line 14, in <module> raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e) django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb

I use Ubuntu server 11.10 amd64 and I installed "python-mysqldb". When I test in Python interpreter, it's ok.

import MySQLdb

I also tried to install by: ~/horizon# easy_install MySQL-python but it only returns that:

Searching for mysql-python Best match: MySQL-python 1.2.3 MySQL-python 1.2.3 is already the active version in easy-install.pth

Using /usr/lib/pymodules/python2.7 Processing dependencies for mysql-python Finished processing dependencies for mysql-python

What's wrong in this case? Thank you!

edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted

answered 2012-02-28 08:56:29 -0600

rafadurancastaneda gravatar image


I think you didn't install MySQL-python on your virtualenv, If I'm right you can install just doing:

$ source .venv/bin/activate $ pip install MySQL-python


$ tools/ pip install MySQL-python

edit flag offensive delete link more

answered 2012-02-28 09:57:35 -0600

tungns-inf gravatar image

Thanks Rafael Durán Castañeda, that solved my question.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2012-02-28 03:40:08 -0600

Seen: 1,256 times

Last updated: Feb 28 '12