Say we are importing some 3rd party package or module called xyz
(that's not "built-in" like datetime
) with import xyz
. xyz
's PyPI name is usually the same, so would appear as xyz
in pip list
. However, as far as I know, there isn't a rule that says this has to be case; for example, google-pasta has its module named pasta
.
Given the name of module or package I'm import
ing, is there a way to determine which PyPI package it came from (besides guessing the PyPI package and looking at the source code)? And conversely, is there a way to tell which packages and modules a given PyPI installation is introducing to the namespace?