问题描述:
利用pip工具安装Scrapy模块时,出现如下异常:
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft VisualC++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
问题分析:
若直接从以上异常的字面含义来看,是需要安装VC++ 14.0之类的程序
也可从先从网络上搜索其他更便捷的解决方案,若不能实现,再作考虑根据所提示的程序进行安装
解决方案:
1. 下载Twisted适配当前系统版本的.whl文件
下载传送门:https://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted
如:Win7 32bit操作系统,Python37运行环境
则下载:Twisted-18.9.0-cp37-cp37m-win32.whl
下载网速可能有点慢,需要确保下载的文件完好无损

2. 安装所下载的.whl文件
在下载的.whl文件的绝对路径下安装Twisted:
pip install D:\Tools007\Twisted-18.9.0-cp37-cp37m-win32.whl

PS:
若此步安装出现异常:
raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file
则可能所下载的.whl程序出现了损坏,可以尝试重新再网络畅通的时候再次下载安装
3. 再次安装Scrapy
pip install Scrapy

查看scrapy命令:

参考资料:
[1] error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
[2] zipfile.BadZipFile: File is not a zip file
网友评论