pipreqs
Pip requirements.txt generator based on imports in project
Decision gist · record as of 2026-08-14
Yes. pipreqs solves a real problem—automating dependency discovery from source code—with low install friction, active maintenance, no security vulnerabilities, and a permissive license. It is most valuable when you need to document or audit dependencies without a full environment setup, or when working with notebooks.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Jupyter notebook scanning (--scan-notebooks) requires nbconvert and ipython; omit that flag or install pipreqs with --no-deps and manually specify yarg==0.1.9 and docopt==0.6.2 if you want a minimal install.
- Low friction install with a pure-Python wheel.
- Maintenance is active with recent commits and a large repository community (7463 stars).
License · maintenance · safety
Apache-2.0 (permissive) — Licensed under Apache-2.0 (permissive), allowing commercial and private use with minimal restrictions—suitable for most development workflows.
last release 2024-02-18 (908 days) · last repo commit 2026-03-30 · 7,463 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 991,444 downloads/mo, #4,560 on PyPI
Alternatives
Verify before relying
pip install pipreqs
pipreqs /path/to/project
# or with output to stdout:
pipreqs --print /path/to/project- Whether the package correctly handles all modern import patterns in complex codebases.
- Accuracy of version pinning when querying PyPI or custom servers under network constraints.
- How well the tool handles edge cases in projects with conditional or dynamic imports.
What it is and what it does
pipreqs is a command-line tool that analyzes Python source files in a project directory and generates a requirements.txt file by detecting all imported packages. Unlike pip freeze, which lists everything installed in your environment, pipreqs reads your actual code to identify only the packages you use, making it useful for documenting dependencies in new projects or cleaning up existing requirement files.
The tool walks the abstract syntax tree of your Python files to extract imports, queries PyPI (or a custom server) to find the latest version of each package, and outputs a requirements.txt with pinned versions. It supports optional features like scanning Jupyter notebooks, comparing against existing requirements, cleaning unused entries, and dynamic versioning schemes (e.g., ~= or >=). Runtime dependencies include yarg, docopt, nbconvert, and ipython.
Use it for
- Quickly bootstrap a requirements.txt for a new project without manually listing every import.
- Audit and clean an existing requirements.txt by comparing it to actual imports in the codebase.
- Generate requirements for a project you've inherited without needing to install all dependencies first.
- Scan Jupyter notebooks alongside Python files to capture all notebook-based dependencies.
- Use a custom PyPI server or proxy in restricted network environments.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
pipreqs solves a real problem—automating dependency discovery from source code—with low install friction, active maintenance, no security vulnerabilities, and a permissive license. It is most valuable when you need to document or audit dependencies without a full environment setup, or when working with notebooks.
Install
pipreqs on PyPI
Before you install
Low friction install with a pure-Python wheel. Maintenance is active with recent commits and a large repository community (7463 stars). Supports Python 3.8 through 3.12 with no known vulnerabilities.
Jupyter notebook scanning (--scan-notebooks) requires nbconvert and ipython; omit that flag or install pipreqs with --no-deps and manually specify yarg==0.1.9 and docopt==0.6.2 if you want a minimal install.
License in practice
Licensed under Apache-2.0 (permissive), allowing commercial and private use with minimal restrictions—suitable for most development workflows.
Quickstart
pip install pipreqs
pipreqs /path/to/project
# or with output to stdout:
pipreqs --print /path/to/project
Verify before relying
- Whether the package correctly handles all modern import patterns in complex codebases.
- Accuracy of version pinning when querying PyPI or custom servers under network constraints.
- How well the tool handles edge cases in projects with conditional or dynamic imports.
Package facts
| License | Apache-2.0 permissive |
| Python support | Capped below the current Python release >=3.8.1,<3.13 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 4 packagesyargdocoptnbconvertipython |
| Maintenance | Actively maintained 908 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 991,444 / month, #4,560 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseNatural Language :: EnglishProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9 |
Evidence: pipreqs-0.5.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “generate requirements.txt from imports”
- pipreqsScans Python project source code to detect imported packages and…
- pipreqs-fivetranScans Python project source files and Jupyter notebooks to detect…
- pip-check-reqsAudits Python project imports against requirements.txt to find…
Give your agent the search over MCP, or paste the wish link into any chat.
More Build Tools packages
Provides reusable utilities for Python packaging interoperability, including version handling, specifiers, markers, requirements, tags, and metadata parsing according to standards like PEP 440 and PEP 425.
Wraps any iterable to display a real-time progress bar in the terminal or Jupyter notebook, showing iteration count, elapsed time, and estimated time remaining.
pip is the standard installer for Python packages, enabling you to download and install packages from the Python Package Index and other indexes into your Python environment.
Hatchling is a standards-compliant Python build backend that handles packaging, metadata, and distribution of Python projects when configured in a project's pyproject.toml file.
Generates Python gRPC service stubs and message classes from Protocol Buffer definitions, enabling developers to build gRPC clients and servers.
pre-commit is a framework for installing and running git hooks written in any language before commits are made, automating code quality and validation checks across multi-language projects.
Install it if your team needs consistent, automated validation at commit time.
See also pipreqs-fivetran · to-requirements.txt · pip-check-reqs · liccheck · yarg · pip-chill · pyproject-dependencies · creosote · pex · absolufy-imports