scrappy lib in /usr/lib/python2.7/site-packages/scrapy
my project catalog:
.../projects/scrapy
.../projects/parser_module
....../projects/parser_module/parser
....../projects/parser_module/parser
........../projects/parser_module/parser/spiders/.....
........../projects/parser_module/parser/<files etc>
....../projects/parser_module/scrapy.cfg
In directory .../projects/parser_module/
I am set command scrapy crawl parser
and get result:
Traceback (most recent call last):
File "/usr/bin/scrapy", line 4, in <module>
execute()
File "/usr/lib/python2.7/site-packages/scrapy/cmdline.py", line 109, in execute
settings = get_project_settings()
File "/usr/lib/python2.7/site-packages/scrapy/utils/project.py", line 60, in get_project_settings
settings.setmodule(settings_module_path, priority='project')
File "/usr/lib/python2.7/site-packages/scrapy/settings/__init__.py", line 108, in setmodule
module = import_module(module)
File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named settings
Can you please tell me how to solve the problem?
to avoid such issue create your project folder with scrapy startproject parser_module
now to fix your issue, you either have a fresh start or create a dummy project with scrapy startproject
to copy setting.py from. Then maybe next error you will find other missing file in this folder.
This is the typical structure of a scrapy project.
.
├── scrapy.cfg
└── project_name
├── __init__.py
├── items.py
├── settings.py
└── spiders
└── __init__.py
spider.py
To solve "ImportError: No module named *.settings", try to change project name and related settings in scrapy.cfg
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With