安装mysql-python (依赖mysql-devel)
可以用命令”pip installmysql-python” 尝试。
如果失败,有如下错误,请安装mysql-devel(yum installmysql-devel)
[root@localhost tmp]# pip installmysql-python
Collecting mysql-python
Using cached MySQL-python-1.2.5.zip
Complete output fromcommand python setup.py egg_info:
sh: mysql_config:command not found
Traceback (most recentcall last):
File"<string>", line 20, in <module>
File"/tmp/pip-build-0fKR5I/mysql-python/setup.py", line 17, in<module>
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.pyegg_info" failed with error code 1 in /tmp/pip-build-0fKR5I/mysql-python
download安装mysql-devel rpm包
link:https://rpmfind.net/linux/rpm2html/search.php?query=mysql-devel
rpm -ivh mysql-devel-5.5.47-1.el6.remi.x86_64.rpm