I have 3 directories under S1
S1
- D1
--python1.py
- D2
--python2.py
- D3
--python3.py
In python3.py module, I have a statement(below) to import python2.py
import D2.python2
when I run python3.py I get a error " No module named D2.python2"
How can I fix this issue?
Note: I have __init__.py in all the directories to signify packages.
from .. import D2.python2, but a python program cannot import from higher directories than the directory it was started, so python3 (with the python2-import-statement) has to be importet from a file in s1 (or higher)