如果提示了如下错误:
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
可以先去下载whl安装包:https://www.lfd.uci.edu/~gohlke/pythonlibs/
注意要和python的版本对应,我这里是Python3.8 64位:
之后将其文件名改为
mysqlclient-1.4.6-cp38-cp38m-win_amd64.whl
,然后执行pip安装:
pip install mysqlclient-1.4.6-cp38-cp38m-win_amd64.whl
安装成功!