# sudo pip install mysql-python
此时会提示找不到mysql-config文件,我们安装一下mysql-community-devel
# sudo yum install -y mysql-community-devel
完成之后 ,重新来一遍 sudo pip install mysql-python,之后又提示我电脑缺少gcc编译工具和缺少Python.py文件。异常如下:
_mysql.c:29:20: fatal error: Python.h: No such file or directory #include "Python.h" ^ compilation terminated. error: command 'gcc' failed with exit status 1
那好安装gcc:
# sudo yum install -y gcc
安装Python.py依赖模块:
# sudo yum install python-devel
解决了之后
sudo pip install mysql-python
成功安装。