Some packages are imported with a string which is different from the name of the package on PyPI, e.g.:
$ pip list | grep -i "yaml\|qt"
PyYAML 3.13
QtPy 1.5.2
- pyyaml (pip instal pyyaml), but import yaml
- qtpy (pip install qtpy), yes import is qtpy but package is QtPy
Several tools can't not handle that, e.g sphinx:
$ make html
WARNING: autodoc: failed to import module 'wireshark' from module 'logcollector.plugins'; the following exception was raised:
No module named 'qtpy'
I don't remember it right now, but same is for tools which scan the requirements.txt file and print warnings that the yaml package isn't installed (but it is and its name is pyyaml).
Because these two concepts are not really related.
One is a python concept of package/module names, the other one a package manager concept.
Look at a simple packaging command with zip:
The Tool is named
tool, which probably is not unique and if you do not know that its MyCoolTool you do not know whichtoolit is. When I upload it somewhere I name itMyCoolTool, so you now a more unique name, that may be a bit more descriptive.The other point is, that a pip package may include more modules than just one.
PyYAMLcould for example include a second python moduleyaml2xmlin addtion toyaml.Finally there can be several implementations.
PyYAMLsounds like a pure python implementation. Now assume you need a really fast parser, then you may programCYAMLwith a C-backend, but the same interface at the nameyaml.