attributes of the module object you only need to set pythonpath to import from directories other than the one in which you are working ( the current directory when working interactivelyor the directory containing your top-level filein practicethis will be common case for nontrivial programs the five major components of the module import search path are the top-level script' home directory (the directory containing it)all directories listed in the pythonpath environment variablethe standard library directoriesall directories listed in pth path files located in standard placesand the site-packages root directory for third-party extension installs of theseprogrammers can customize pythonpath and pth files python might load source code pyfilea byte code pyc or pyofilea extension module ( so file on linux or dll or pyd file on windows)or directory of the same name for package imports imports may also load more exotic things such as zip file componentsjava classes under the jython version of pythonnet components under ironpythonand statically linked extensions that have no files present at all in factwith import hooksimports can load arbitrary items namespace is self-contained package of variableswhich are known as the attributes of the namespace object module' namespace contains all the names assigned by code at the top level of the module file ( not nested in def or class statementstechnicallya module' global scope morphs into the module object' attributes namespace module' namespace may also be altered by assignments from other files that import itthough this is generally frowned upon (see for more on the downsides of cross-file changes modulesthe big picture