I'm staring to package my python code. My package structure is:
mypackage/
__init__.py
/subpackage
__init__.py
module1.py
module2.py
In my module2, if I use absolute importing like:
from mypackage.subpackage import module1
this will work.
However, If I use explicit importing like:
from . import module1
This gives me
ImportError: attempted relative import with no known parent package
I've googling about this and find out that implicit relative import is not good. But my import is explicit and it gives me such an error message. Can somebody help me understand why? Thanks