1.首先要先下载,MysqLdb下载地址:
https://pypi.python.org/pypi/MysqL-python/1.2.5
2. unzip MysqL-python-1.2.5;
3. cd MysqL-python-1.2.5;
python setup.py install;
此时报错:
Traceback (most recent call last):
File "setup.py",line 17,in <module>
Metadata,options = get_config()
File "/root/MysqL-python-1.2.5/setup_posix.py",line 43,in get_config
libs = MysqL_config("libs_r")
File "/root/MysqL-python-1.2.5/setup_posix.py",line 25,in MysqL_config
raise EnvironmentError("%s not found" % (MysqL_config.path,))
EnvironmentError: MysqL_config not found
原因是没有安装MysqL-devel;
yum install MysqL-devel;
4.重新运行python setup.py install;