How to list PyPI package names corresponding to an import in a script?

Is there a way to list the PyPi names that correspond to the imported modules in the script?

For example, to import a module scapy3k(this is its name) I need to use

import scapy.all

but the actual package to install is scapy-python3. The last one is what I want to extract from what I find in the instructions import(in this case, I am not interested in his name - scapy3k).

There are other examples (which are currently avoiding me) of packages that have a name pip installcompletely different from what is used importlater.

+4
source share
1

pypi name, setup.py/setup.cfg. , , . , 100% pypi, , ( , OP).

+1

All Articles