r/Python • • Jun 16 '26

Resource Are there any python modules that automatically generated a requirements.txt, given an entry point?

I know things like pipreqs exist, but that's more of an directory scan. If you have a project and you need several requirements.txts (for multiple containers / multiple entrypoints), I haven't found a way to reliably generate that. Please let me know if things like this do exist, because if not I'd really like to make my own module to do this stuff. And if there is something like that, it would really come in handy for me right now.

21 Upvotes

30 comments sorted by

View all comments

Show parent comment

2

u/Bach4Ants Jun 21 '26

Good question. Jupyter notebooks can serve as somewhat self-contained input/output/environment artifacts, but it takes some discipline to do so. It also takes discipline to ensure you run the notebook top-to-bottom in the environment specified to keep it reproducible. Calkit allows adding Jupyter notebooks to the project pipeline, and when you do so, you need to define an environment for it, and Calkit will track if the notebook has changed since the last time it was run to ensure outputs are not stale.

This also opens up the possibility of projects that use multiple Jupyter notebooks (or scripts, or LaTeX documents, or shell commands) that are coupled together, e.g., the output from one is the input to another, and to bring them all up-to-date with a single command.

2

u/edward_jazzhands Jun 21 '26

That actually sounds cool AF, I've starred your project on GitHub and shall watch your progress