I had the same error and pip install MySQL-python solved it for me.
Alternate installs:
- If you don’t have pip,
easy_install MySQL-pythonshould work. - If your python is managed by a packaging system, you might have to use
that system (e.g.sudo apt-get install ...)
Below, Soli notes that if you receive the following error:
EnvironmentError: mysql_config not found
… then you have a further system dependency issue. Solving this will vary from system to system, but for Debian-derived systems:
sudo apt-get install python-mysqldb