MySQLdb module in python


Hi ,

I was getting this error while running python script. Could you please check how to connect to mysql db from python , or let me know if there is any alternative way

import MySQLdb

ImportError: No module named MySQLdb



mysqldb is a module for Python that doesn’t come pre-installed. Please try to install using command

pip install mysql-python


While doing that pip install it is showing this error.

Collecting mysql-python
Using cached
Complete output from command python egg_info:
sh: mysql_config: command not found
Traceback (most recent call last):
File “”, line 1, in
File “/tmp/pip-build-47cRdK/mysql-python/”, line 17, in
metadata, options = get_config()
File “”, line 43, in get_config
libs = mysql_config(“libs_r”)
File “”, line 25, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found


Command “python egg_info” failed with error code 1 in /tmp/pip-build-47cRdK/mysql-python/


The error that you are getting is on which OS?


i was trying to install in itversity instance only , ie in linux


@BaLu_SaI: wich package are you trying to install?
If you want any package to install we will take care of it. Let us know it. If it is compatible with our environment we will setup it.