from versus import with packages import statements can be somewhat inconvenient to use with packagesbecause you may have to retype the paths frequently in your program in the prior section' examplefor instanceyou must retype and rerun the full path from dir each time you want to reach if you try to access dir or mod directlyyou'll get an errordir mod nameerrorname 'dir is not defined mod nameerrorname 'modis not defined it' often more convenientthereforeto use the from statement with packages to avoid retyping the paths at each access perhaps more importantlyif you ever restructure your directory treethe from statement requires just one path update in your codewhereas imports may require many the import as extensiondiscussed formally in the next can also help here by providing shorter synonym for the full pathand renaming tool when the same name appears in multiple modulesc:\codepython from dir dir import mod dir init dir init in mod py mod from dir dir mod import import dir dir mod as mod mod from dir dir mod import as modz modz code path here only don' repeat path use shorter name (see ditto if names clash (see why use package importsif you're new to pythonmake sure that you've mastered simple modules before stepping up to packagesas they are somewhat more advanced feature they do serve useful rolesthoughespecially in larger programsthey make imports more informativeserve as an organizational toolsimplify your module search pathand can resolve ambiguities first of allbecause package imports give some directory information in program filesthey both make it easier to locate your files and serve as an organizational tool without package pathsyou must often resort to consulting the module search path to find files why use package imports