I am trying to programatically find information (such as version number) about imported modules using:
pip show *insert package name*
In Python this looks like:
subprocess.check_output([sys.executable, '-m', 'pip', 'show', *packagename*]).decode("utf-8")
However, the name that is passed as argument to PIP to find information is not always the same as the name used to import the module.
Is there a way to find the name that PIP uses, from the name you use to import the module?