MySQLdb module in python

MySQLdb module in python
0.0 0

#1

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

Thanks


#2

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

pip install mysql-python


#3

While doing that pip install it is showing this error.

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

----------------------------------------

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


#4

The error that you are getting is on which OS?


#5

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


#6

@dileepdominic
@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.


#7