the new from syntax for local package filesor full absolute paths module lookup rules summary with packages and relative importsthe module search story in python that we have seen so far can be summarized as followsbasic modules with simple names ( aare located by searching each directory on the sys path listfrom left to right this list is constructed from both system defaults and user-configurable settings described in packages are simply directories of python modules with special __init__ py filewhich enables directory path syntax in imports in an import of cfor examplethe directory named is located relative to the normal module import search of sys pathb is another package subdirectory within aand is module or other importable item within within package' filesnormal import and from statements use the same sys path search rule as imports elsewhere imports in packages using from statements and leading dotshoweverare relative to the packagethat isonly the package directory is checkedand the normal sys path lookup is not used in from import afor examplethe module search is restricted to the directory containing the file in which this statement appears python works the sameexcept that normal imports without dots also automatically search the package directory first before proceeding on to sys path in sumpython imports select between relative (in the containing directoryand absolute (in directory on sys pathresolutions as followsdotted importsfrom import are relative-only in both and nondotted importsimport mfrom import are relative-then-absolute in xand absolute-only in as we'll see laterpython adds another flavor to modules--namespace packages-which is largely disjointed from the package-relative story we're covering here this newer model supports package-relative imports tooand is simply different way to construct package it augments the import search procedure to allow package content to be spread across multiple simple directories as last-resort resolution thereafterthoughthe composite package behaves the same in terms of relative import rules relative imports in action but enough theorylet' run some simple code to demonstrate the concepts behind relative imports package relative imports