1.安装mysqlclient
pip install mysqlclient -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn
2.遇到的问题
1)报错信息
安装mysqlclient报错 error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Buil
解决方案:
下载链接:https://pan.baidu.com/s/19F4YurwwZ5A9WF5txzMZoQ 提取码:ka7q
进行默认安装,下载其他地方的这个visualcppbuildtools_full.exe文件都会提示:“安装包丢失或毁坏”,只有这个网盘的下的是可以用的
2)报错信息
MySQLdb/_mysql.c(29) : fatal error C1083: Cannot open include file: 'mysql.h': No such file or direc
解决方案
下载对应的.whl文件:https://www.lfd.uci.edu/~gohlke/pythonlibs/
a.我的python是3.6.5,并且是32位(这里的多少位不是系统的而是python的)
b.下载对应的.whl
c.安装 .whl文件:pip install D:\downloads\mysqlclient-1.4.6-cp36-cp36m-win32.whl
d.下面就可以正常安装mysqlclient了