Usage
Description
Display the project’s dependency tree, showing how packages depend on each other. By default, the tree is filtered to match the current platform and Python version. Use--universal to display the tree for all platforms, or use --python-version or --python-platform to filter for specific environments.
Options
Display Options
--universal
Show a platform-independent dependency tree.Shows resolved package versions for all Python versions and platforms, rather than filtering to those that are relevant for the current environment.Multiple versions may be shown for each package.
Maximum display depth of the dependency tree.Short form:
-dPrune the given package from the display of the dependency tree.
Display only the specified packages.
--no-dedupe
Do not de-duplicate repeated dependencies.By default, uv will de-duplicate dependencies that appear multiple times in the tree.
--invert
Show the reverse dependencies for the given package.Short form:
-iDependency Selection
Include dependencies from the specified dependency group.May be provided multiple times.
Disable the specified dependency group.This option always takes precedence over default groups,
--all-groups, and --group.May be provided multiple times.Environment variable: UV_NO_GROUP--all-groups
Include dependencies from all dependency groups.
--no-group can be used to exclude specific groups.--no-default-groups
Ignore the default dependency groups.uv includes the groups defined in
tool.uv.default-groups by default. This disables that option, however, specific groups can still be included with --group.Environment variable: UV_NO_DEFAULT_GROUPSOnly include dependencies from the specified dependency group.The project and its dependencies will be omitted.May be provided multiple times. Implies
--no-default-groups.--only-dev
Only include the development dependency group.The project and its dependencies will be omitted.This option is an alias for
--only-group dev. Implies --no-default-groups.Locking Options
--locked
Assert that the
uv.lock will remain unchanged.Requires that the lockfile is up-to-date. If the lockfile is missing or needs to be updated, uv will exit with an error.Environment variable: UV_LOCKED--frozen
Display the requirements without locking the project.If the lockfile is missing, uv will exit with an error.Environment variable:
UV_FROZENScript Options
Show the dependency tree for the specified PEP 723 Python script, rather than the current project.If provided, uv will resolve the dependencies based on its inline metadata table, in adherence with PEP 723.
Python Options
The Python interpreter to use for locking and filtering.By default, the tree is filtered to match the platform as reported by the Python interpreter. Use
Environment variable:
--universal to display the tree for all platforms, or use --python-version or --python-platform to override a subset of markers.See uv help python for details on Python discovery and supported request formats.Short form: -pEnvironment variable:
UV_PYTHONThe Python version to use when filtering the tree.For example, pass
--python-version 3.10 to display the dependencies that would be included when installing on Python 3.10.Defaults to the version of the discovered Python interpreter.The platform to use when filtering the tree.For example, pass
--platform windows to display the dependencies that would be included when installing on Windows.Represented as a “target triple”, a string that describes the target platform in terms of its CPU, vendor, and operating system name, like x86_64-unknown-linux-gnu or aarch64-apple-darwin.Examples
Display basic dependency tree
Show universal tree
Limit tree depth
Show reverse dependencies
requests.
Prune packages from display
pytest and mypy from the tree (but shows their dependencies).
Show specific packages
requests and urllib3.
Show without deduplication
Filter by Python version
Filter by platform
Show tree for a script
Show only dev dependencies
Include specific dependency groups
Common Patterns
Debugging dependency conflicts
Checking cross-platform dependencies
Understanding dependency depth
Analyzing specific packages
CI/CD verification
Output Format
The tree output shows package dependencies in a hierarchical format:--invert, the tree is reversed to show dependents: