How pipreqs cut a Python project's requirements.txt from 214 packages to 23
A software team discovered their Python project's requirements.txt had ballooned to 214 packages, most of which the codebase never actually used, because pip freeze snapshots everything installed in an environment regardless of real imports. The bloated file slowed Docker builds, triggered false vulnerability alerts, and left developers too afraid to remove any dependency. The team switched to pipreqs, a tool that statically scans Python source files and lists only the packages the code actually imports. After running pipreqs, the requirements file shrank to just 23 packages, eliminating noise and restoring confidence in the project's dependency list. The episode highlights a key distinction: pip freeze answers what is installed, while pipreqs answers what the code genuinely needs.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in