pip3 install mysql-python
安装出错:
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
原因:
Python3支持pyMySQL,python3以前的版本支持mysql-python。
解决方法:pip3 install pyMySQL
python文件导入mysql驱动:
import pymysql