【问题标题】:Python requirements.txt that shows which package installed which?Python requirements.txt 显示哪个包安装了哪个?
【发布时间】:2017-11-07 06:30:14
【问题描述】:

我最近看到一个 python requirements.txt 文件,其中的条目如下所示:

hyper==15.2.1              # via twisted
iddna==1.5                 # via cryptography, requests

换句话说,它识别出哪个包负责安装另一个包作为依赖项。我想知道是否有我不知道的工具,或者作者是否手动添加了 cmets。或者是否有 pip freeze 的秘密选项?

【问题讨论】:

    标签: python pip requirements.txt


    【解决方案1】:

    添加到 requirements.txt 的这些 cmets 不是从 pip freeze 选项 (pip freeze docs) 生成的。他们很可能来自pip-tools。从自述文件中,pip-compile 命令将生成一个requirements.txt,其中这些 cmets 显示父依赖项。希望这会有所帮助。

    【讨论】:

      猜你喜欢
      • 2012-02-13
      • 2016-11-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-12-03
      • 2017-11-25
      相关资源
      最近更新 更多