正文
python3.6.4 scrapy框架from PIL import Image报错 from . import _imaging as core
小程序:扫一扫查出行
【扫一扫了解最新限行尾号】
复制小程序
【扫一扫了解最新限行尾号】
复制小程序
scrapy框架爬取url下载图片时,用ImagesPipeline下载图片
from PIL import Image报错 from . import _imaging as core
ImportError: DLL load failed: The specified module could not be found.
1 #导入ImagesPipeline
2 from scrapy.pipelines.images import ImagesPipeline
3 #报错位置
4 from PIL import Image
报的错是DLL加载错误,找不到指定组件,这个原因很大一部分是python和Pillow版本问题。
我的python版本是3.6.4,Pillow4.0.0,将Pillow升级至最新就可以用了。
我用的是anaconda更新:控制台窗口输入
.....anaconda3\python.exe(anaconda位置) -m pip install upgrade Pillow
更新完之后再爬取,一切正常。