print(string<=relative in both and code\pkg\string py print('ni when we import the string module with relative import syntax like thiswe get the version in the package in both and xas desiredc:\codec:\python \python same result in import pkg spam nininininininini when absolute syntax is usedthoughthe module we get varies per version again interprets this as relative to the package firstbut makes it "absolute,which in this case really just means it skips the package and loads the version relative to the cwd --not the version in the standard librarycode\string py print('string code\pkg\spam py import string print(string<=relative in "absolutein xcwdcode\pkg\string py print('ni :\codec:\python \python import pkg spam stringstringstringstringstringstringstringstring :\codec:\python \python import pkg spam nininininininini as you can seealthough packages can explicitly request modules within their own directories with dotstheir "absoluteimports are otherwise still relative to the rest of the normal module search path in this casea file in the program using the package hides the standard library module the package may want the change in simply allows package code to select files either inside or outside the package ( relatively or absolutelybecause import resolution can depend on an enclosing context that may not be foreseenthoughabsolute imports in are not guarantee of finding module in the standard library experiment with these examples on your own for more insight in practicethis is not usually as ad hoc as it might seemyou can generally structure your importssearch pathsand module names to work the way you wish during development you should keep in mindthoughthat imports in larger systems may depend upon context of useand the module import protocol is part of successful library' design module packages