pip freeze without dependencies of installed packages

后端 未结 2 502
心在旅途
心在旅途 2020-12-08 19:40

When I do pip freeze I get the packages I\'ve explicitly installed plus those packages that are dependencies of those packages.

For example:

<         


        
相关标签:
2条回答
  • 2020-12-08 20:11

    Now there is (disclaimer: I did it).

    All you need is to install pip-chill from PyPI and run pip-chill from your Python environment.

    If you are feeling adventurous and don't want to pin versions (or want to use pip-compile), you can use pip-chill --no-version and it'll give you the minimal requirements for your current environment.

    https://github.com/rbanffy/pip-chill

    0 讨论(0)
  • 2020-12-08 20:22

    There is no way to create "the most simplified requirements.txt" with pip - and I don't know if you would need it in this case.

    It is good to have all packages in the requirements.txt, because you are sure about what dependencies versions work with your environment.

    Think about paramiko getting updated, and breaking backwards compatibilities: you would have problems.

    0 讨论(0)
提交回复
热议问题