name strings is the actual search path within pythonon importspython searches each directory in this list from left to rightand uses the first file match it finds reallysys path is the module search path python configures it at program startupautomatically merging the home directory of the top-level file (or an empty string to designate the current working directory)any pythonpath directoriesthe contents of any pth file paths you've createdand all the standard library directories the result is list of directory name strings that python searches on each import of new file python exposes this list for two good reasons firstit provides way to verify the search path settings you've made--if you don' see your settings somewhere in this listyou need to recheck your work for examplehere is what my module search path looks like on windows under python with my pythonpath set to :\code and \python \mypath pth path file that lists :\users\mark the empty string at the front means current directoryand my two settings are merged inthe rest are standard library directories and files and the site-packages home for third-party extensionsimport sys sys path [''' :\\code'' :\\windows\\system \\python zip'' :\\python \\dlls'' :\\python \\lib'' :\\python '' :\\users\\mark'' :\\python \\lib\\site-packages'secondif you know what you're doingthis list provides way for scripts to tailor their search paths manually as you'll see by example later in this part of the bookby modifying the sys path listyou can modify the search path for all future imports made in program' run such changes last only for the duration of the scripthoweverpythonpath and pth files offer more permanent ways to modify the path--the first per userand the second per installation on the other handsome programs really do need to change sys path scripts that run on web serversfor exampleoften run as the user "nobodyto limit machine access because such scripts cannot usually depend on "nobodyto have set pythonpath in any particular waythey often set sys path manually to include required source directoriesprior to running any import statements sys path append or sys path insert will often sufficethough will endure for single program run only module file selection keep in mind that filename extensions ( pyare omitted from import statements intentionally python chooses the first file it can find on the search path that matches the imported name in factimports are the point of interface to host of external components--source codemultiple flavors of byte codecompiled extensionsand more python automatically selects any type that matches module' name modulesthe big picture