在windows下,在dos中运行pip install Scrapy报错: building ‘twisted.test.raiser’ extension error: Microsoft Visual C++ 14.0 is required.
解决方案:
http://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted 下载twisted对应版本的whl文件(如我的Twisted‑17.5.0‑cp36‑cp36m‑win_amd64.whl),cp后面是Python版本,amd64代表64位,运行命令:
pip install C:\Users\CR\Downloads\Twisted-17.5.0-cp36-cp36m-win_amd64.whl
其中install后面为完整路径名
安装完成后,再次运行:
pip install Scrapy
即可成功。
from .. import etree ImportError: DLL load failed: 找不到指定的程序。
File “D:\Program Files (x86)\Python\Scripts\scrapy.exe_main.py”, line 5,
n <module>
File “d:\program files (x86)\python\lib\site-packages\scrapy_init.py”, li
e 34, in <module>
from scrapy.spiders import Spider
File “d:\program files (x86)\python\lib\site-packages\scrapy\spiders_init_
py”, line 10, in <module>
from scrapy.http import Request
File “d:\program files (x86)\python\lib\site-packages\scrapy\http_init.py
, line 11, in <module>
from scrapy.http.request.form import FormRequest
File “d:\program files (x86)\python\lib\site-packages\scrapy\http\request\for
.py”, line 11, in <module>
import lxml.html
File “d:\program files (x86)\python\lib\site-packages\lxml\html_init.py”,
line 54, in <module>
from .. import etree
ImportError: DLL load failed: 找不到指定的程序。
解决方案:
查证是lxml版本的问题
先pip uninstall lxml
然后去http://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted
选择对应的lxml版本下载