今天学习网络爬虫的信息与提取时,要用到scrapy,于是打开cmd:
C:\Users\tianyaliaowang>pip install scrapy
出现了很多下载进度,窃喜安装这个框架没有什么问题。
结果后面还是报错了。。。
ERROR: Could not find a version that satisfies the requirement zope.interface>=4.4.2 (from Twisted>=13.1.0; python_version != "3.4"->scrapy) (from versions: none)
ERROR: No matching distribution found for zope.interface>=4.4.2 (from Twisted>=13.1.0; python_version != "3.4"->scrapy)
很奇怪,于是上网搜索了这个错误。果然,早有先辈遇到过这个错误了。然而有个人将这个比作为玄学。我看了一遍它的文章,玄学?不相信,哪有什么玄学。。。于是看了另一篇文章,一个Java转python的,写了一大篇文章,安装了十多个其它的库,最终才安装上scrapy。
看的过程中,我发现报错和两篇文章,三者都有一个共同点,都是安装完twisted后才能安装好scrapy。
于是,
C:\Users\tianyaliaowang>pip install twisted
然后:
C:\Users\tianyaliaowang>pip install scrapy
最后:
Successfully installed PyDispatcher-2.0.5 asn1crypto-0.24.0 cffi-1.12.3
cryptography-2.7 cssselect-1.1.0 parsel-1.5.2
pyOpenSSL-19.0.0 pyasn1-0.4.7
pyasn1-modules-0.2.6 pycparser-2.19 queuelib-1.5.0
scrapy-1.7.3 service-identity-18.1.0 w3lib-1.21.0
每次看到Successfully
都激动的内牛满面〒▽〒
哪有什么玄学,只是没有发现问题的本质罢了。