Even with an __init__.py
in the parent directory.
parentDir\
__init__.py
targetDir\
__init__.py
something.py
thisDir\
main.py
In main.py:
import .targetDir.something
This does not work. I tried:
from . import targetDir
from targetDir import something
This doesn't work, either. Are there any Pythonic solutions for doing something as simple as importing a module from a directory in the parent directory?