relative import

An import inside a package that names a sibling module with a leading dot, such as from .helpers import tidy, instead of the full package path.

In more detail

Absolute imports, from mypkg import helpers, are clearer and work the same everywhere, which is why the course prefers them. Relative imports only work inside a package, not in a file run directly as a script.

Related terms

Taught in

References