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