site configuration files typical python installation may include number of third-party modules and packages to configure these packagesthe interpreter first imports the module site the role of site is to search for package files and to add additional directories to the module search path sys path in additionthe site module sets the default encoding for unicode string conversions the site module works by first creating list of directory names constructed from the values of sys prefix and sys exec_prefix as followssys prefixwindows only sys exec_prefixwindows only sys prefix 'lib/pythonvers/site-packages'sys prefix 'lib/site-python'sys exec_prefix 'lib/pythonvers/site-packages'sys exec_prefix 'lib/site-pythonin additionif enableda user-specific site packages directory may be added to this list (described in the next sectionfor each directory in the lista check is made to see whether the directory exists if soit' added to the sys path variable nexta check is made to see whether it contains any path configuration files (files with pth suffixa path configuration file contains list of directorieszip filesor egg files relative to the location of the path file that should be added to sys path for examplefoo package configuration file 'foo pthfoo bar each directory in the path configuration file must be listed on separate line comments and blank lines are ignored when the site module loads the fileit checks to see whether each directory exists if sothe directory is added to sys path duplicated items are added to the path only once after all paths have been added to sys pathan attempt is made to import module named sitecustomize the purpose of this module is to perform any additional (and arbitrarysite customization if the import of sitecustomize fails with an importerrorthe error is silently ignored the import of sitecustomize occurs prior to adding any user directories to sys path thusplacing this file in your own directory has no effect the site module is also responsible for setting the default unicode encoding by defaultthe encoding is set to 'asciihoweverthe encoding can be changed by placing code in sitecustomize py that calls sys setdefaultencoding(with new encoding such as 'utf- if you're willing to experimentthe source code of site can also be modified to automatically set the encoding based on the machine' locale settings per-user site packages normallythird-party modules are installed in way that makes them accessible to all users howeverindividual users can install modules and packages in per-user site directory on unix and macintosh systemsthis directory is found under ~local and is named something such as ~local/lib/python /site-packages on windows systemsthis directory is determined by the %appdataenvironment variablef lib fl ff