对于不同的系统和程序有如下的解决方法:
- 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)
参考:https://www.cnblogs.com/guohaojintian/p/6030818.html