at base levelpackage imports are straightforward--in the place where you have been naming simple file in your import statementsyou can instead list path of names separated by periodsimport dir dir mod the same goes for from statementsfrom dir dir mod import the "dottedpath in these statements is assumed to correspond to path through the directory hierarchy on your computerleading to the file mod py (or similarthe extension may varythat isthe preceding statements indicate that on your machine there is directory dir which has subdirectory dir which contains module file mod py (or similarfurthermorethese imports imply that dir resides within some container directory dir which is component of the normal python module search path in other wordsthese two import statements imply directory structure that looks something like this (shown with windows backslash separators)dir \dir \dir \mod py or mod pycmod soetc the container directory dir needs to be added to your module search path unless it' the home directory of the top-level fileexactly as if dir were simple module file more formallythe leftmost component in package import path is still relative to directory included in the sys path module search path list we explored in from there downthoughthe import statements in your script explicitly give the directory paths leading to modules in packages packages and search path settings if you use this featurekeep in mind that the directory paths in your import statements can be only variables separated by periods you cannot use any platform-specific path syntax in your import statementssuch as :\dir my documents dir or /dir -these do not work syntactically insteaduse any such platform-specific syntax in your module search path settings to name the container directories for instancein the prior exampledir --the directory name you add to your module search path--can be an arbitrarily long and platform-specific directory path leading up to dir you cannot use an invalid statement like thisimport :\mycode\dir \dir \mod errorillegal syntax but you can add :\mycode to your pythonpath variable or pth fileand say this in your scriptimport dir dir mod module packages