damnever / pigar

:coffee: A tool to generate requirements.txt for Python project, and more than that. (IT IS NOT A PACKAGE MANAGEMENT TOOL)

Home Page:https://damnever.github.io/pigar/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pigar uses underscores instead of hyphens

rusmux opened this issue · comments

For packages with hyphens in their names, pigar uses underscores instead of hyphens. This way pip and conda do not recognize these packages and cannot find them.

commented

I believe python stores modules in this way (with underscores in the site-packages folder). But in my case pip has no issue installing packages with underscores instead of hyphens.
Possible solution could be to just replace the underscores to normalize names as described in PEP503.
re.sub(r"[-_.]+", "-", name).lower()