错误描述:
环境win10 64位 python 3.6.3
使用
pip install mysql-python 报错:
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
解决办法:
在 https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python 下载对应的whl文件.
MySQL-python, a Python database API 2.0 interface for the MySQL database
Consider mysqlclient, a Python 3 compatible fork of MySQL-python.
因为我的是64位,所以选择下面的MySQL_python‑1.2.5‑cp27‑none‑win_amd64.whl下载到本地.回到 CMD 命令中 pip install D:\Python\MySQL_python-1.2.5-cp27-none-win_amd64.whl 刚才下载的具体路径.
此时依然没有成功又出现错误:
MySQL_python-1.2.5-cp27-none-win_amd64.whl is not a supported wheel on this platform.
通过print(pip.pep425tags.get_supported())查看到MySQL_python-1.2.5-cp27-none-win_amd64.whl文件名格式不被支持 通过修改文件名再安装(具体内容可移步这位老哥) => http://blog.csdn.net/csdnjava2017/article/details/78159346
将刚才下载的MySQL_python‑1.2.5‑cp
27‑none‑win_amd64.whl文件名改为MySQL_python‑1.2.5‑cp
36‑none‑win_amd64.whl.
继续运行 pip install D:\Python\MySQL_python-1.2.5-cp36-none-win_amd64.whl
>>:
Installing collected packages: MySQL-python
Successfully installed MySQL-python-1.2.5