I tried the answers in this question to no avail so I thought it'd be worth a separate question. The directory layout is as follows:
aale/
2/
2.py
__init__.py
3/
3.py
__init__.py
__init__.py
The names are unfortunately unable to change (this is the layout given to us for a HW problem). I am trying to import 2
from 3
but it doesn't seem to be working. I tried using importlib
as:
two = importlib.import_module('2.2')
as well as
two = importlib.import_module('2')
which didn't work also (gave a ModuleNotFoundError: No module named '2'
error). Any help / other methods would be appreciated. I am using Python 3.6.