Background
I have a package i'm working on which i have also installed into site-packages. (I've installed my own package using pip)
Question
How does Python know to import from the "local" code (the code i'm working on), rather than importing from site-packages? I'm asking because i want to better understand and i'm worried that somehow i might import code from site-packages when i really want to use my own (latest) code
It’s confusing to me that this is not more clear in how we write imports. It seems to me that the programmer doesn’t know if she is importing her own code or importing from site-packages. Am i missing something here?
One thought i had was to use relative imports but if i understand they are not recommended in general
I'm using Python 3.8.5