django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb

Solution 1:

It looks like you don't have the python mysql package installed, try:

pip install mysql-python

or if not using a virtual environment (on *nix hosts):

sudo pip install mysql-python

Solution 2:

If you get errors trying to install mysqlclient with pip, you may lack the mysql dev library. Install it by running:

apt-get install libmysqlclient-dev

and try again to install mysqlclient:

pip install mysqlclient

Solution 3:

you have to install python-mysqldb - Python interface to MySQL

Try
sudo apt-get install python-mysqldb