Skip to content

name collision of spider with existing module #2680

@swoertz

Description

@swoertz

The problem arises when I generate a spider with the name of an already existing module e.g., csv, urllib,...
My guess is that the import mechanism imports the existing module, which most likely does not contain a spider, instead of the generated spider. Hence the no spider found message.

$ scrapy version
Scrapy 1.3.3
$ scrapy genspider csv csv.com
Created spider 'csv' using template 'basic' 
$ scrapy runspider csv.py 
2017-03-23 16:55:14 [scrapy.utils.log] INFO: Scrapy 1.3.3 started (bot: scrapybot)
2017-03-23 16:55:14 [scrapy.utils.log] INFO: Overridden settings: {'SPIDER_LOADER_WARN_ONLY': True}
Usage
=====
  scrapy runspider [options] <spider_file>

runspider: error: No spider found in file: csv.py

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions