Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DJANGO_SETTINGS_MODULE #1

Closed
weisong82 opened this issue Mar 6, 2017 · 1 comment
Closed

DJANGO_SETTINGS_MODULE #1

weisong82 opened this issue Mar 6, 2017 · 1 comment

Comments

@weisong82
Copy link

[root@iZj6cay283146nzk0n83czZ scrapyLinkedIn]# scrapy crawl linkedin
Traceback (most recent call last):
File "/usr/local/bin/scrapy", line 11, in
sys.exit(execute())
File "/usr/local/lib/python3.4/site-packages/scrapy/cmdline.py", line 141, in execute
cmd.crawler_process = CrawlerProcess(settings)
File "/usr/local/lib/python3.4/site-packages/scrapy/crawler.py", line 238, in init
super(CrawlerProcess, self).init(settings)
File "/usr/local/lib/python3.4/site-packages/scrapy/crawler.py", line 129, in init
self.spider_loader = _get_spider_loader(settings)
File "/usr/local/lib/python3.4/site-packages/scrapy/crawler.py", line 325, in _get_spider_loader
return loader_cls.from_settings(settings.frozencopy())
File "/usr/local/lib/python3.4/site-packages/scrapy/spiderloader.py", line 33, in from_settings
return cls(settings)
File "/usr/local/lib/python3.4/site-packages/scrapy/spiderloader.py", line 20, in init
self._load_all_spiders()
File "/usr/local/lib/python3.4/site-packages/scrapy/spiderloader.py", line 29, in _load_all_spiders
self._load_spiders(module)
File "/usr/local/lib/python3.4/site-packages/scrapy/spiderloader.py", line 23, in _load_spiders
for spcls in iter_spider_classes(module):
File "/usr/local/lib/python3.4/site-packages/scrapy/utils/spider.py", line 25, in iter_spider_classes
if inspect.isclass(obj) and
File "/usr/local/lib/python3.4/inspect.py", line 83, in isclass
return isinstance(object, type)
File "/usr/local/lib/python3.4/site-packages/django/utils/functional.py", line 226, in inner
self._setup()
File "/usr/local/lib/python3.4/site-packages/django/conf/init.py", line 42, in _setup
% (desc, ENVIRONMENT_VARIABLE))
django.core.exceptions.ImproperlyConfigured: Requested settings, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.

@eracle
Copy link
Owner

eracle commented Apr 15, 2017

The project doesn't use Django. You should create its virtual environment and activate it. Maybe you are using another virtual env.
Follow this tutorial:
http://python-guide-pt-br.readthedocs.io/en/latest/dev/virtualenvs/

@eracle eracle closed this as completed Apr 21, 2017
eracle pushed a commit that referenced this issue May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants