question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error Running Scrapy through script(Py/Shell)

See original GitHub issue

1)Running the Scrapy command from the Python script with the subprocess

from subprocess import call import sys

sys.path.append(“SCRAPYPROJECTPATH”) call ([“scrapy”,“crawl”,“example”])

2)Running the Shell Script from the Python Script (The call value from the above script changes to sh shellscriptname.sh)

Output

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 109, in execute
    settings = get_project_settings()
  File "/usr/local/lib/python2.7/dist-packages/scrapy/utils/project.py", line 60, in get_project_settings
    settings.setmodule(settings_module_path, priority='project')
  File "/usr/local/lib/python2.7/dist-packages/scrapy/settings/__init__.py", line 108, in setmodule
    module = import_module(module)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named project.settings

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

0reactions
kmikecommented, Aug 18, 2016

@kgrvamsi it should work in Scrapy 1.0+, including Scrapy 1.0.5. Note that Scrapy 1.0.x is no longer supported by us; upgrading to 1.1.x is a good idea 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python Shell not running Scrapy - Stack Overflow
when i run it in command shell i get just the text output i want. i've tested on bbc sport and wiki so...
Read more >
Scrapy shell — Scrapy 2.7.1 documentation
The Scrapy shell is an interactive shell where you can try and debug your scraping code very quickly, without having to run the...
Read more >
Automate the boring stuff chapter 11: Web Scraping
You could take a few steps out of this task by writing a simple script to automatically launch the map in your browser...
Read more >
Run Scrapy Spiders from Python Script - YouTube
Learn how to call Scrapy spider from main.py, a question that I get often. You will learn how to run Scrapy multiple spiders...
Read more >
Scrapy From one Script: ProcessCrawler - YouTube
In this video I'll show you how to use the Scraper ProcessCrawler to run a scrapy spider without using scrapy crawl command.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found