Windows环境的scrapy-deltafetch安装

 

  (2017-10-27 23:48:50)

转载

标签: 

scrapy-deltafetch

 

bsddb3

 

.whl

分类: Python

为了实现scrapy的增量去重爬取,实现更加灵活、适应性更强的爬取策略,在部署Scrapy项目时,最好使用scrapy-deltafetch插件。官方网址是:https://pypi.python.org/pypi/scrapy-deltafetch/1.0.1

 

官方的说法是:

Windows环境的scrapy-deltafetch安装_第1张图片
于是,进行pip install scrapy-deltafetch

报错:with open(os.path.join(incdir, 'db.h'), 'r') as f : FileNotFoundError: [Errno 2] No such file or directory: 'db/include\\db.h'

 

阅读文档,查找经验,发现scrapy-deltafetch是依赖于Berkeley DB的,所以必须先安装bsddb3.

 

进入Oracle Berkeley DB(python)的官网,下载msi installer,安装成功。于是,进行pip install scrapy-deltafetch报错。

 

百度各种文档,都是在linux环境下安装bsddb3的技术贴,windows下无解。Stack Overflower有位大哥直接就说“在windows”上安装bsddb3是浪费时间(“One don't really want to spend couple of nights compiling that on Windows”)。所以,放弃使用pip 或 setup.py等方法在Windows上安装bsddb3。

 

最后,选择使用编辑好的Unofficial Windows Binaries for Python Extension Packages, 网址为http://www.lfd.uci.edu/~gohlke/pythonlibs,这个网址包含几乎所有在Windows上安装容易出错的库,直接pip install 这些.whl文件就好。

 

例如:

Windows环境的scrapy-deltafetch安装_第2张图片
 

在此基础上,在pip install scrapy-deltafetch

Info: Successfully!

你可能感兴趣的:(Python)