scrapy框架爬取url下載圖片時,用ImagesPipeline下載圖片python
from PIL import Image報錯 from . import _imaging as core框架
ImportError: DLL load failed: The specified module could not be found.scrapy
1 #導入ImagesPipeline 2 from scrapy.pipelines.images import ImagesPipeline 3 #報錯位置 4 from PIL import Image
報的錯是DLL加載錯誤,找不到指定組件,這個緣由很大一部分是python和Pillow版本問題。url
個人python版本是3.6.4,Pillow4.0.0,將Pillow升級至最新就能夠用了。spa
我用的是anaconda更新:控制檯窗口輸入code
.....anaconda3\python.exe(anaconda位置) -m pip install upgrade Pillowblog
更新完以後再爬取,一切正常。圖片