1

I have a scrapy project that utilizes an item pipeline. I used the Scrapy "startproject" command to create my project so I think my folder structure is accurate.

I've tried moving the VersionSpider.py file to the outer directory, the same directory as the items module, and that works. However when I run the scrapy crawl command it can't find the spider since it's not in the proper directory.

File Structure: ~files

from CFBScraper.items import VersionItem
ModuleNotFoundError: No module named 'CFBScraper'
Justin
  • 58
  • 1
  • 8
  • Check out [this post](https://stackoverflow.com/questions/14132789/relative-imports-for-the-billionth-time) it should help you out. – MyNameIsCaleb Oct 06 '19 at 02:03
  • @MyNameIsCaleb That did look helpful, but when I use the package name, CFBScraper, I'm still getting the error. – Justin Oct 06 '19 at 02:06
  • Can you post your item and pipeline scripts? – reg202 Oct 07 '19 at 13:13
  • Actually, post the spider too please. Does the spider script run at all? Is that error specific to that import items line? – reg202 Oct 07 '19 at 13:29
  • Your `CFBScraper` folder is not a Python module. [Make it a Python module](https://stackoverflow.com/a/15747198/939364). – Gallaecio Oct 16 '19 at 10:08

1 Answers1

0

Its because your both folders are with same name CFBScraper

Do this, rename your top folder to something else like CFB_Scraper or something other and it will work

Umair Ayub
  • 19,358
  • 14
  • 72
  • 146
  • Thanks for the tip. Unfortunately, renaming the top level folder does not solve the problem of the "ModuleNotFoundError" – Justin Oct 06 '19 at 14:32