first of allas mentioned previouslythis feature does not impact imports outside package thusthe following finds the standard library string module as expectedc:\codec:\python \python import string string but if we add module of the same name in the directory we're working init is selected insteadbecause the first entry on the module search path is the current working directory (cwd)code\string py print('string :\codec:\python \python import string stringstringstringstringstringstringstringstring string in other wordsnormal imports are still relative to the "homedirectory (the top-level script' containeror the directory you're working inin factpackage relative import syntax is not even allowed in code that is not in file being used as part of packagefrom import string systemerrorparent module 'not loadedcannot perform relative import in this sectioncode entered at the interactive prompt behaves the same as it would if run in top-level scriptbecause the first entry on sys path is either the interactive working directory or the directory containing the top-level file the only difference is that the start of sys path is an absolute directorynot an empty stringcode\main py import string print(stringc:\codec:\python \python main py stringstringstringstringstringstringstringstring same code but in file equivalent results in similarlya from import string in this nonpackage file fails the same as it does at the interactive prompt--programs and packages are different file usage modes imports within packages nowlet' get rid of the local string module we coded in the cwd and build package directory there with two modulesincluding the required but empty test\pkg \__init__ py file package roots in this section are located in the cwd added automatically to sys pathso we don' need to set pythonpath 'll also largely omit empty module packages