Imagine this directory structure:
app/
__init__.py
sub1/
__init__.py
mod1.py
sub2/
__init__.py
mod2.py
I\'
From Python doc,
In Python 2.5, you can switch import‘s behaviour to absolute imports using a
from __future__ import absolute_importdirective. This absolute- import behaviour will become the default in a future version (probably Python 2.7). Once absolute imports are the default,import stringwill always find the standard library’s version. It’s suggested that users should begin using absolute imports as much as possible, so it’s preferable to begin writingfrom pkg import stringin your code