pip -e: No magic underscore to dash replacement

前端 未结 2 610
刺人心
刺人心 2021-02-04 00:18

Somewhere underscores get changed to dashes, if you install with a git repo with \"pip install -e ...\".

Is there any way to stop this?

I want to automate stuff.

2条回答
  •  被撕碎了的回忆
    2021-02-04 00:43

    From what I can see from this question and this response on the Python mailing list it looks like this is due to numerous naming conventions throughout the Python packaging system, and the compatibility between them.

    Pythons setuptools runs safe_name which:

    Convert an arbitrary string to a standard distribution name

    Any runs of non-alphanumeric/. characters are replaced with a single '-'.

    Even though pip, easy_install and PyPi may accept the underscore, when installing it is changed to a single '-' for setuptools standards.

提交回复
热议问题