1.先看报错截图:
2.报错信息:
a) error: subprocess-exited-with-error
Running setup.py install for mysqlclient did not run successfully.
b)
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> mysqlclient
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
问题解决:
1.登录网址https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient
找到MySQL client对应的python版本,windows本地使用win32,虚拟环境使用adm
2.下载完成后,cmd进入到下载的目录地址,执行命令pip install xxx.whl
问题解决。