Home > other >  Python packages and modules of the import problem
Python packages and modules of the import problem

Time:12-18

Package has several modules, such as Amy polumbo y and p. y,
I direct import in a b is ok, but if the package program c.p calls a y, you will be prompted a file of import of b b module does not exist, how to correct the import?

CodePudding user response:

I know the reason for failure is sys. Run path within the package in the package and outbound guild have different, what method can not only in the package external use package module, also can run within the package test these modules?

CodePudding user response:

Try this line not line
In Amy polumbo y and p. y file to import through package path
Such as Amy polumbo import b y file from package, in p. y file from package import a
  • Related