{"id":1628,"library":"pipdeptree","title":"pipdeptree","description":"pipdeptree is a command-line utility that displays the installed Python packages in a dependency tree format. It helps visualize package relationships and identify issues like duplicate or conflicting dependencies. Maintained by the tox-dev team, it is actively developed with frequent minor releases, currently at version 2.34.0.","status":"active","version":"2.34.0","language":"en","source_language":"en","source_url":"https://github.com/tox-dev/pipdeptree","tags":["cli","package management","dependencies","visualization","packaging"],"install":[{"cmd":"pip install pipdeptree","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"note":"Used for programmatic access to the dependency graph data structure, primarily for advanced use cases.","symbol":"PackageDAG","correct":"from pipdeptree import PackageDAG"},{"note":"For programmatic rendering of the dependency tree as JSON. Note that post v2.29.0, these functions print directly rather than returning a string.","symbol":"render_json","correct":"from pipdeptree import render_json"}],"quickstart":{"code":"pip install virtualenv\npython -m venv .venv\nsource .venv/bin/activate\npip install requests\npipdeptree\n# Display as JSON\npipdeptree --output=json\n# Display only top-level packages (depth 1)\npipdeptree --depth 1","lang":"bash","description":"This quickstart demonstrates how to install pipdeptree in a virtual environment and use it to display a dependency tree. It shows basic output, JSON output, and filtering by depth. Ensure you activate your virtual environment before running `pipdeptree`."},"warnings":[{"fix":"Upgrade to Python 3.10+ or pin pipdeptree version to <2.29.0.","message":"Python 3.9 support was dropped in version 2.29.0. Users on Python 3.9 or older must upgrade their Python version or use pipdeptree < 2.29.0.","severity":"breaking","affected_versions":">=2.29.0"},{"fix":"Instead of capturing the return value, redirect standard output if you need to capture the rendered string (e.g., `import io, sys; old_stdout = sys.stdout; sys.stdout = new_stdout = io.StringIO(); render_json(...); output = new_stdout.getvalue(); sys.stdout = old_stdout`).","message":"For programmatic users, render functions (e.g., `render_json`, `render_text`) now print directly to standard output instead of returning a string. This change was introduced in version 2.29.0.","severity":"breaking","affected_versions":">=2.29.0"},{"fix":"Prefer using `pipdeptree --output=format` (e.g., `pipdeptree --output=json`) for specifying the output format.","message":"The `--output` option was introduced in 2.30.0 to centralize output format selection. While older flags like `--json` may still work, `--output=json`, `--output=dot`, etc., are the preferred and more consistent way to specify formats.","severity":"gotcha","affected_versions":">=2.30.0"},{"fix":"For most common use cases, prefer invoking `pipdeptree` as a shell command rather than importing its modules directly.","message":"pipdeptree is primarily a command-line interface (CLI) tool. While it exposes some internal components for programmatic use, its public API for direct imports might not be as stable or fully documented as its CLI interface.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}