pipreqs

0.5.0 · active · verified Sun Apr 12

pipreqs is a Python utility that automatically generates a `requirements.txt` file for a project based on the import statements found in its Python files and Jupyter notebooks. It aims to create a clean, minimal list of direct dependencies, avoiding the inclusion of unused packages or the entire environment as `pip freeze` does. The current version is 0.5.0, and releases occur irregularly, with significant updates like Jupyter support recently added.

Warnings

Install

Quickstart

To generate a `requirements.txt` file, navigate to your project's root directory and run `pipreqs .`. If your project includes Jupyter notebooks, use the `--scan-notebooks` flag. You can also preview the requirements without saving by using `--print`.

# Navigate to your project's root directory
# Generate requirements.txt for Python files:
pipreqs .

# Generate requirements.txt including Jupyter notebooks:
pipreqs . --scan-notebooks

# To print to console without saving to file:
pipreqs . --print

view raw JSON →