简体   繁体   中英

Python requirements.txt that shows which package installed which?

I recently saw a python requirements.txt file with entries that look like this:

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

In other words, it identifies which package was responsible for installing another as a dependency. I'm wondering if there's a tool out there that I don't know about or if the author has added the comments manually. Or is there a secret option for pip freeze?

These comments that were added to the requirements.txt are not generated from a pip freeze option ( pip freeze docs ). They most likely come from pip-tools . From the README, the pip-compile command will produce a requirements.txt with those comments showing the parent dependency. Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM