Module is an importable component in python. It could be any python source file, or it could be python extensions written in other languages like C or C++. Package to Module is what Directory to File, although not exactly the same. In real world use cases, package is used to reuse and distribute code, since it is more flexible, powerful in many ways.
Normal imports are all absolute imports, Package Imports are relative-then-absolute imports in version before python3.3 and absolute-only in versions after python3.3.
First, what is the running python version?
Python 2.x has old style python import, no relative import.
Is it import inside packages?
Is it relative import or absolute import?
The only valid relative import is like:
from . import xxx
#or
from .. import xxx
#or
from .dir import xxx
It is always a from style import, the from string always starts with one or two dots. And only use relative imports inside a package, or it will generate an error. An ImportError will be generated if search fails inside current package.
Absolute imports looks like this:
import os
from os import path
from os.path import isdir
This Relative-then-Absolute behaviours is only available in Python 2.x, it has the exactly same style with absolute imports.
This is only available in Python3.3+. Namespace package requires no init.py files, and it is a vritual package, its content could span multiple phisical locations.