have to pardon the shell commands hereand translate for your platform) :\codedel stringdel __pycache__\stringfor bytecode in :\codemkdir pkg :\codenotepad pkg\__init__ py code\pkg\spam py import eggs print(eggs <=works in but not xcode\pkg\eggs py import string print(stringthe first file in this package tries to import the second with normal import statement because this is taken to be relative in but absolute in xit fails in the latter that is searches the containing package firstbut does not this is the incompatible behavior you have to be aware of in xc:\codec:\python \python import pkg spam :\codec:\python \python import pkg spam importerrorno module named 'eggsto make this work in both and xchange the first file to use the special relative import syntaxso that its import searches the package directory in toocode\pkg\spam py from import eggs print(eggs <=use package relative import in or code\pkg\eggs py import string print(stringc:\codec:\python \python import pkg spam :\codec:\python \python import pkg spam package relative imports