Windows python3下安装scrapy爬虫框架的完美方案
1. 背景
- Scrapy依赖的库比较多,至少需要依赖库有Twisted,lxml,pyOpenSSL,pywin32等。而且现在scrapy尚未全面过渡到python3,所以安装和使用起来会存在一些问题。尤其是在Windows下。
- 在win7直接使用pip install scrapy安装会出现如下错误:
# 提示缺少Twisted
Command ""d:\program files\python36\python.exe" -u -c "import setuptools, tokeni
ze;__file__='C:\\Users\\SEELE\\AppData\\Local\\Temp\\pip-build-jaaqsgel\\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\SEELE\AppData\Local\Temp\pip-wodz4dbl-record\install-record.txt --single-
version-externally-managed --compile" failed with error code 1 in C:\Users\SEELE
\AppData\Local\Temp\pip-build-jaaqsgel\Twisted\