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:\users\lyn\appdata\local\programs\python\python37\python.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('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\LYN\AppData\Local\Temp\pip-record-qr8kh7_p\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\LYN\AppData\Local\Temp\pip-install-tj4h87_l\mysql-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文件名的方法,雖然我親測無效,但是還是列在此處
如果選擇的版本為
需要把文件名改為
