error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
----------------------------------------
Command "c:userslynappdatalocalprogramspythonpython37python.exe -u -c "import setuptools, tokenize;__file__='C:\Users\LYN\AppData\Local\Temp\pip-install-tj4h87_l\mysql-python\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('
', '
');f.close();exec(compile(code, __file__, 'exec'))" install --record C:UsersLYNAppDataLocalTemppip-record-qr8kh7_pinstall-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:UsersLYNAppDataLocalTemppip-install-tj4h87_lmysql-python
我的python版本信息为:
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] on win32
解决办法:下载whl文件手动安装
下载地址:https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python
选择版本(选择的版本cp后的值要和python版本对应,否则会报错“is not a supported wheel on this platform.”)
到下载目录下执行命令
- pip3 install .MySQL_python-1.2.5-cp37-none-win32.whl
关于下载的whl文件在安装时报错“is not a supported wheel on this platform.”网上还有一种直接修改whl文件名的方法,虽然我亲测无效,但是还是列在此处
如果选择的版本为
需要把文件名改为