1

My directory structure for the Glue extra.py/library files looks like this:

├── script1.py
├── folder1
│   └── script2.py

I can import script1.py like normal:

from script1 import foo

But when I try for script2.py:

from folder1.script2 import foo

it doesn't work and it will trigger an exception saying Module folder1 not found.

Any help on this?

DmcZx
  • 67
  • 10
  • I read in the documentation that `Only individual files are supported, not a directory path`, on your example, are there limitations on your approach if you consider all your files within a folder and then considering it as a `.whl` file? – Miguel Trejo Sep 18 '20 at 03:07
  • Yeah, I've read that too in the documentation and was wondering is that some sort of workaround in managing a large library of files. I never tried with a `.whl` but I would like to avoid that as it adds additional steps to setup a Glue job. Thanks for the feedback though. – DmcZx Sep 23 '20 at 03:52

1 Answers1

0

You should put a "__init__.py" file in the folder1.

This is useful for understanding about "__init__.py".

What is __init__.py for?

e-zuka
  • 1
  • 3