title: KeyError: 'Spider not found: spider'
body: <p>I have a Scrapy project called crawler.</p>
  <p>my spider looks like this:</p>
  <pre><code>class WikiSpider(scrapy.Spider):
      name = &quot;wiki-spider&quot;
  
      def start_requests(self):    
          for url in CrawlerUrls().wiki:
              yield scrapy.Request(url=url, callback=self.parse)
  
      def parse(self, response):
          # first part: save pages html to bigdata directory
          page = response.url.split(&quot;/&quot;)[4]
          page_dirname = 'bigdata'
          filename = '%s.html' % page
          with open(os.path.join(page_dirname,filename), 'wb') as f:
              f.write(response.body)
          self.log('Saved file %s' % filename) 
  
          # second part: extract text for the item for document corpus
          item = CrawlerItem()
          item['url'] = response.url
          item['title'] = response.css('h1::text').extract_first()
          item['text'] = response.xpath('//div[@id=&quot;mw-content-text&quot;]//text()')\
                             .extract()                                                             
          tags_list = [response.url.split(&quot;/&quot;)[2],
                       response.url.split(&quot;/&quot;)[3]]
          more_tags = [x.lower() for x in remove_stopwords(response.url\
                              .split(&quot;/&quot;)[4].split(&quot;_&quot;))]
          for tag in more_tags:
              tag = re.sub('[^a-zA-Z]', '', tag)  # alphanumeric values only  
              tags_list.append(tag)
          item['tags'] = tags_list                 
          return item
  </code></pre>
  <p>When I run it, I get this error:</p>
  <pre><code>  File &quot;c:\users\oerha\anaconda3\envs\nlp\lib\site-packages\scrapy\spiderloader.py&quot;, line 71, in load
      raise KeyError(&quot;Spider not found: {}&quot;.format(spider_name))
  KeyError: 'Spider not found: spider'
  </code></pre>
  <p>I looked at this other <a href="https://stackoverflow.com/questions/9876793/scrapy-spider-not-found-error">question</a>, it looks like I'm doing everything right.</p>
  <p>this is my setting:</p>
  <pre><code>BOT_NAME = 'crawler'
  
  SPIDER_MODULES = ['crawler.spiders']
  NEWSPIDER_MODULE = 'crawler.spiders'
  </code></pre>
  <p>run-spider.py</p>
  <pre><code>import scrapy  # object-oriented framework for crawling and scraping
  import os  # operating system commands
  
  page_dirnames = ['wiki']
  
  for name in page_dirnames:
    if not os.path.exists(name):
      os.makedirs(name)
  
  # function for walking and printing directory structure
  def list_all(current_directory):
    for root, dirs, files in os.walk(current_directory):
      level = root.replace(current_directory, '').count(os.sep)
      indent = ' ' * 4 * (level)
      print('{}{}/'.format(indent, os.path.basename(root)))
      subindent = ' ' * 4 * (level + 1)
      for f in files:
        print('{}{}'.format(subindent, f))
  
  # examine the directory structure
  current_directory = os.getcwd()
  list_all(current_directory)
  
  # list the avaliable spiders
  print('\nScrapy spider names:\n')
  os.system('scrapy list')
  
  # for JSON lines we use this command
  os.system('scrapy crawl spider -o items.jl')
  print('\nJSON lines written to items.jl\n')
  
  # run the scraper exporting results as a dictionary XML text file items.xml
  # os.system('scrapy crawl quotes -o items.xml')
  </code></pre>
  <p>I run the file using python run-spider.py</p>