使用pip install scrapy安装scrapy时报错
running build_ext
building 'twisted.test.raiser' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
Command "c:\users\1\appdata\local\programs\python\python37-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\1\\AppData\\Local\\Temp\\pip-install-ozuxndrd\\Twisted\\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\1\AppData\Local\Temp\pip-record-qvjcffgx\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\1\AppData\Local\Temp\pip-install-ozuxndrd\Twisted\
处理方法
一开始以为是要到微软官网去下载Microsoft Visual C++ Build Tools工具
下载了好几个也没用(也有可能是下载错了哈哈0.0)
总之遇到问题找度娘,才发现主要看的报错是
building ‘twisted.test.raiser’ extension这一段
到https://www.lfd.uci.edu/~gohlke/pythonlibs去搜索相应版本相关的组件包下载到本地,然后执行pip install 文件名即可
如我的报错,执行以下命令后,再执行安装scrapy命令即可
pip install Twisted-18.9.0-cp37-cp37m-win32.whl