"Sometimes you just want to know about your dependencies, and their dependencies. I've been using pipdeptree for a while, but recently switched to uv pip tree. Let's take a look at both tools. pipdeptree pipdeptree is pip installable, but I don't want pipdeptree itself to be reported alongside everything else installed, so I usually install it outside of a project. We can use it system wide by: Installing with uv tool install pipdeptree. Then running with pipdeptree --python auto Running without installing with uvx pipdeptree --python auto usage The --python auto tells pipdeptree to look at the current environment. Let's take a look at the dependencies in my cards project:"
"(cards) $ pipdeptree --python auto (resolved python: /Users/brianokken/projects/cards/.venv/bin/python) cards==2.0.0 tinydb [required: ==4.8.2, installed: 4.8.2] typer [required: ==0.17.4, installed: 0.17.4] click [required: >=8.0.0, installed: 8.3.0] typing_extensions [required: >=3.7.4.3, installed: 4.15.0] shellingham [required: >=1.3.0, installed: 1.5.4] rich [required: >=10.11.0, installed: 14.1.0] markdown-it-py [required: >=2.2.0, installed: 4.0.0] mdurl [required: ~=0.1, installed: 0.1.2] Pygments [required: >=2.13.0,<3.0.0, installed: 2.19.2] rich [required: ==14.1.0, installed: 14.1.0] markdown-it-py [required: >=2.2.0, installed: 4.0.0] mdurl [required: ~=0.1, installed: 0.1.2] Pygments [required: >=2.13.0,<3.0.0, installed: 2.19.2]"
pipdeptree can be installed outside a project to avoid listing itself among project dependencies and can be run with --python auto to inspect the current environment. pipdeptree prints a hierarchical tree showing packages, version requirements, and installed versions. A virtual environment with the project installed (editable install) is required to reflect project dependencies accurately. uv provides uv pip tree which shows a similar dependency tree formatted with package names and versions and integrates with uv venv and uv pip commands for managing environments and installs.
Read at pythontest.com
Unable to calculate read time
Collection
[
|
...
]