1

I know its been asked million times. However, I still can't figure out my situation.If I create minimal example, my folder structure looks like that:

.
├── Project_L
│   ├── __init__.py
│   ├── items.py
│   ├── middlewares.py
│   ├── pipelines.py
│   ├── settings.py
│   └── spiders
│       ├── First_sp.py
│       └── __init__.py
└── scrapy.cfg

items.py :

import scrapy


class ProjectLItem(scrapy.Item):
     name = scrapy.Field()

And there's just one import line

from Project_L.items import ProjectLItem

I'm getting

'No module named Project_L.items'

Ok, I thought. That's my both right hands. I've downloaded Dimitrios Kouzis-Loukas "Learning Scrapy" book's samples from github. Spitting same error.

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
Lord G.
  • 161
  • 1
  • 3
  • 15
  • remove Project_L before items, keep it like from items import ProjectLItem... – zenwraight May 11 '17 at 22:22
  • 3
    What is doing the import? And what is the working directory/the contents of `sys.path`. You can't find `Project_L` if the parent directory isn't the working directory and doesn't appear in `sys.path`. – ShadowRanger May 11 '17 at 22:24
  • zenwraight: in that case err looks like : No module items; ShadowRangers: Import is importing items. If that what you were asking. sys.path looks like: ['/home/python/Python/code/Project_L/Project_L/spiders', '/usr/local/lib/python2.7/dist-packages/_pdbpp_path_hack', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.7'] – Lord G. May 12 '17 at 23:07

0 Answers0