To check you have MySQLdb installed on your machine.
#!/usr/bin/python
import MySQLdb
If the execution is success, then already installed.
If not, it will throw the below error,
Traceback (most recent call last):
File "test.py", line 3, in <module>
import MySQLdb
ImportError: No module named MySQLdb