So I have directory with following structure:
> current_directory
> submodule
/__init__.py
/some_module.py
/main.py
In the __init__.py
file the following statement is present:
from some_module import some_funciton
Whilst in the main.py
the whole submodule
is imported with: import submodule
.
Now, this executed perfectly fine with Python 2, but the issue is that in Python 3 the import
statement in __init__.py
raises an ImportError
exception: `No module named 'some_module'.
What is the difference between Python 2 and Python 3 when it comes to specifying the hierarchy of the imported files, and how would I go about adjusting the code to work with Python 3?