I have the following structure:
ds/
BST.py
BSTNode.py
When I do
from .BSTNode import BSTNode
inside BST.py
, and I run from the IDLE BST.py
from within ds
I receive the following error:
SystemError: Parent module '' not loaded, cannot perform relative import
Why am I receiving it? Note that I am not asking how to fix the problem, because it would work if I simply do
from BSTNode import BSTNode
i.e. without the leading .
. I just want to understand better how the Python's import system works.
Note that theoretically I should not need any __init__.py
within ds
because I am using Python 3.5. If I am not clear enough, just ask!
Thank you!!!!