No modules name Items in scrapy
Question: When i run My spider in scrapy it show no modules name items

In Items file i have defined only two items and i need to make csv for that
items and in spider file iam importing that file and in console importing
error is shown below

Here is code of items file :

    
    
    import scrapy
    
    class OddsItem(scrapy.Item):
        Title = scrapy.Field()
        Date = scrapy.Field()
    

Here is code of spider:

    
    
    import scrapy
    import time
    from odds.items import OddsItem
    from selenium import webdriver
    
    
    class OddsSpider(scrapy.Spider):
        name = "odds"
      ...... other code ....
    

Error in console :

    
    
    Traceback (most recent call last):
      File "/usr/local/bin/scrapy", line 11, in <module>
        sys.exit(execute())
      File "/usr/local/lib/python2.7/dist-packages/scrapy/cmdline.py", line 142, in execute
        cmd.crawler_process = CrawlerProcess(settings)
      File "/usr/local/lib/python2.7/dist-packages/scrapy/crawler.py", line 209, in __init__
        super(CrawlerProcess, self).__init__(settings)
      File "/usr/local/lib/python2.7/dist-packages/scrapy/crawler.py", line 115, in __init__
        self.spider_loader = _get_spider_loader(settings)
      File "/usr/local/lib/python2.7/dist-packages/scrapy/crawler.py", line 296, in _get_spider_loader
        return loader_cls.from_settings(settings.frozencopy())
      File "/usr/local/lib/python2.7/dist-packages/scrapy/spiderloader.py", line 30, in from_settings
        return cls(settings)
      File "/usr/local/lib/python2.7/dist-packages/scrapy/spiderloader.py", line 21, in __init__
        for module in walk_modules(name):
      File "/usr/local/lib/python2.7/dist-packages/scrapy/utils/misc.py", line 71, in walk_modules
        submod = import_module(fullpath)
      File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
        __import__(name)
      File "/home/yohack/scraping_scrapy/odds/odds/odds/spiders/odds.py", line 3, in <module>
        from odds.items import OddsItem
    ImportError: No module named items
    


Answer: Scrapy generates the following directory structure by default

    
    
    odds/
    |
    |---scrapy.cfg            # deploy configuration file
    |
    `---odds/             # project's Python module, you'll import your code from here
        |
        |---__init__.py
        |
        |---items.py          # project items file
        |
        |---pipelines.py      # project pipelines file
        |
        |---settings.py       # project settings file
        |
        `---spiders/          # a directory where you'll later put your spiders
            |
            |---__init__.py
            |
            `---odds.py
    

.

    
    
    from odds.items import OddsItem
    

Looks for items.py in the `odds` directory containing `__init__`.py and
spiders directory by default. Check if you have this structure right. Also
make sure you have `__init__`.py file in that folder it tells python to look
for sub modules in that directory.

