今年来,网上很多地方,都说Scrapy已经支持python3了。于是我也去安装学习学习。
win10环境,我用pip install scrapy 很顺利就安装完成了。
但是!!关键就在这个但是!
scrapy在使用的时候报错: NameError: name 'file' is not defined!
开始在网上找这个错误的解决方法。
网上有好几个关于这个错误的解决信息,我仔细看了看,都是来源于CSDN上的一个博客链接: scrapy在Python3版本运行问题 。这篇文章,看发表日期,是不适合这个问题解决的。
我接着在网上找。在知乎上,发现了一个关于Scrapy的话题。有很多回答明确说明scrapy已经支持python3。但是有一个答主说win还不支持!
看到这里,我的心都碎了。弄了这么半天,我的每一个步骤都是按照要求来的,结果是这样!!
-------------------------------------------------
最后,大家还是要再等等。Scrapy应该还不支持win下的python。
这是我查到的Scrapy公布的信息。Python 3 is Coming to Scrapy
Python 3 Limitations
This beta release includes some limitations for Python 3 (which will not affect Python 2 users):
- Scrapy doesn’t work yet in Windows with Python 3
- S3 downloads are not supported yet
- Sending emails is not supported yet
- Telnet is not supported yet
- FTP download handler is not supported yet
- Some non-ASCII URLs may fail in Scrapy with Python 3
If you want the full details of all the benefits of this new release, check out the release notes.
2016-5-5