To import, to find a module, it must either be in sys.path. This usually includes "so it searches for the current directory. If you download the" application "from the project, it will find it, since it is in the current directory.
Well, this is obvious stuff. The confusing bit is that Python remembers which modules are loaded. If you download the application, then you download the application2, which imports the application, the "application" module is already loaded. It does not need to be searched on disk; it just uses the one that is already loaded. On the other hand, if you have not downloaded the application yet, it will search for it - and will not find it, because it is not in the same directory as the download of it ("."), Or anywhere else in the path.
This can lead to a strange case where imports sometimes work and sometimes not; it only works if it is already loaded.
If you want to be able to load these modules as an “application”, you need to organize a project /, which will be added to sys.path.
(Relative imports affect the sound, but it looks like application and application2 are separate packages - relative imports are used to import within the same package.)
Finally, be sure to sequentially process all of this as a package or sequentially process each application as its own package. Do not mix or mix. If the package / is in the path (for example, sys.path includes the package / ..), then you can really do "from package.application import foo", but if you also do "from the application import foo", this is possible for Python does not understand that this is one and the same thing - their names are different, and they are in different ways - and as a result, two different copies are downloaded that you definitely do not need.
source share