Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
D

deptry

> DevOps
Open source

Find unused, missing and transitive dependencies in a Python project.

1.4K stars0 likes0 views
WebsiteGitHub

About

Find unused, missing and transitive dependencies in a Python project.

_deptry_ is a command line tool to check for issues with dependencies in a Python project, such as unused or missing dependencies. It supports projects using [Poetry](https://python-poetry.org/), [pip](https://pip.pypa.io/), [PDM](https://pdm-project.org/), [uv](https://docs.astral.sh/uv/), and more generally any project supporting [PEP 621](https://peps.python.org/pep-0621/) specification.

Dependency issues are detected by scanning for imported modules within all Python files in a directory and its subdirectories, and comparing those to the dependencies listed in the project's requirements.


Documentation - Contributing


Quickstart

Installation

To add deptry to your project, run one of the following commands:

bash
# Install with uv
uv add --dev deptry

# Install with poetry
poetry add --dev deptry

# Install with pip
pip install deptry

Warning: When using pip to install deptry, make sure you install it within the virtual environment of your project. Installing deptry globally will not work, since it needs to have access to the metadata of the packages in the virtual environment.

Prerequisites

deptry should be run within the root directory of the project to be scanned, and the project should be running in its own dedicated virtual environment.

Usage

To scan your project for dependency issues, run:

bash
deptry .

Example output could look as follows:

bash
Scanning 2 files...

foo/bar.py:1:0: DEP004 'numpy' imported but declared as a dev dependency
foo/bar.py:2:0: DEP001 'matplotlib' imported but missing from the dependency definitions
pyproject.toml: DEP002 'pandas' defined as a dependency but not used in the codebase
Found 3 dependency issues.

Configuration

deptry can be configured by using additional command line arguments, or by adding a [tool.deptry] section in pyproject.toml. For more information, see the Usage and Configuration documentations.


Repository initiated with osprey-oss/cookiecutter-poetry.

Issues· 68 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Pythoncicddependenciespep621poetry

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
CategoryDevOps
PricingOpen source

> Related tools

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理