Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "D:\anzhuang\Anaconda\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 682, in runfile
execfile(filename, namespace)
File "D:\anzhuang\Anaconda\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 71, in execfile
exec(compile(scripttext, filename, 'exec'), glob, loc)
File "D:/python/novelspider/main.py", line 10, in <module>
cmdline.execute("scrapy crawl novelspider".split())
File "D:\anzhuang\Anaconda\lib\site-packages\scrapy\cmdline.py", line 142, in execute
cmd.crawler_process = CrawlerProcess(settings)
File "D:\anzhuang\Anaconda\lib\site-packages\scrapy\crawler.py", line 209, in __init__
super(CrawlerProcess, self).__init__(settings)
File "D:\anzhuang\Anaconda\lib\site-packages\scrapy\crawler.py", line 115, in __init__
self.spider_loader = _get_spider_loader(settings)
File "D:\anzhuang\Anaconda\lib\site-packages\scrapy\crawler.py", line 296, in _get_spider_loader
return loader_cls.from_settings(settings.frozencopy())
File "D:\anzhuang\Anaconda\lib\site-packages\scrapy\spiderloader.py", line 30, in from_settings
return cls(settings)
File "D:\anzhuang\Anaconda\lib\site-packages\scrapy\spiderloader.py", line 21, in __init__
for module in walk_modules(name):
File "D:\anzhuang\Anaconda\lib\site-packages\scrapy\utils\misc.py", line 71, in walk_modules
submod = import_module(fullpath)
File "D:\anzhuang\Anaconda\lib\importlib\__init__.py", line 37, in import_module
__import__(name)
File "novelspider\spiders\novelspider.py", line 11, in <module>
from novelspider.items import NovelspiderItem
ImportError: No module named items
原因:spider目录下的.py文件的名字跟项目的名字是一样的
解决方法:将spider目录下的.py文件的名字更改为与项目不一样的名字。