Possible Duplicate:
How to install MySQLdb (Python data access library to MySQL) on Mac OS X?
Although this question has been asked before here, the question and subsequent answers that are posted there are relevant to OS X (Snow Leopard) and not to OS X Lion and OS X Mountain Lion. There were patches for Python and MySQL that shipped in OS X Lion and OS X Mountain Lion that impact the process of installing the Python-MySQLdb-connector smoothly on Mac OS X 10.7 (Lion) and Mac OS X 10.8 (Mountain Lion). This is is the only reason this question is being repeated. Please feel free to refer to the old question in case you are running an older version of OS X.
I am running OS X 10.8.2 (Mountain Lion) and have python 2.7.2 installed -
==> python
Python 2.7.2 (default, Jun 20 2012, 16:23:33)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
But when I run import MySQLdb on python, it fails with the following message -
==> python
Python 2.7.2 (default, Jun 20 2012, 16:23:33)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named MySQLdb
Any input would be helpful.