ImportError: No module named MySQLdb


ImportError: No module named MySQLdb
[root@server pwd]# pip install MySQLdb
Collecting MySQLdb
Could not find a version that satisfies the requirement MySQLdb (from versions: )
No matching distribution found for MySQLdb

[root@server MySQL-python-1.2.5]# python install
sh: mysql_config: command not found
Traceback (most recent call last):
File “”, line 17, in
metadata, options = get_config()
File “/root/MySQL-python-1.2.5/”, line 43, in get_config
libs = mysql_config(“libs_r”)
File “/root/MySQL-python-1.2.5/”, line 25, in mysql_config
raise EnvironmentError(“%s not found” % (mysql_config.path,))
EnvironmentError: mysql_config not found

yum -y install mysql-devel

easy_install mysql-python (mix os)
pip install mysql-python (mix os)
apt-get install python-mysqldb (Linux Ubuntu)
cd/usr/ports/databases/py-MySQLdb && make install clean (FreeBSD)
yum install MySQL-python (linux Fedora, CentOS)
pip install mysqlclient (Windows)


Captcha Code