I have an AWS Python lambda. The directory structure is as follows”
src
__init__.py
main.py
service.py
I am initiating a detabase connection in __init__.py
file and then importing the connection variable in main.py
from . import conn
I get the following error:
ImportError: attempted relative import with no known parent package.
I am new to Python and trying to get a hang of the imports. Shouldn’t main.py
have access to everything from __init__.py
since they are in the same package called src