I dug into this when it first came up. From what I could figure, the problem is that pkg_resources
looks for .dist-info
directories in sys.path
. Any dist-info directory is identified as an installed distribution (thus listed by pip list
), with the directory name parsed as distribution name (thus the dash-prefixed display).
I must admit there are (quite many) parts of pkg_resources
I couldn’t fully figure out. Maybe this is another sign we should work on State of importlib.metadata - #7 by barry