导入scrapy时出现此错误:
AttributeError: module 'scrapy' has no attribute 'Spider'
我已经阅读了这篇文章 Can't run Scrapy program ,但仍然感到困惑,因为我已经卸载并安装了scrapy两次但仍然得到相同的错误,所提到的帖子的讨论让我感到困惑。这是我第一次安装srapy和进口scrapy时它工作正常。但过了一段时间后它开始给我这个错误。
编辑: 检查版本我得到这个堆栈跟踪:
C:\Users\hadi>scrapy version
Traceback (most recent call last):
File "c:\users\hadi\appdata\local\programs\python\python36-32\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\users\hadi\appdata\local\programs\python\python36-32\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\hadi\AppData\Local\Programs\Python\Python36-32\Scripts\scrapy.exe\__main__.py", line 5, in <module>
File "c:\users\hadi\appdata\local\programs\python\python36-32\scrapy.py", line 3, in <module>
class QuotesSpider(scrapy.Spider):
AttributeError: module 'scrapy' has no attribute 'Spider'
我自己解决了尝试通过miniconda安装。谢谢BTW