Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit

…v0.0.270 (#411)

* chore(deps): update pre-commit hook charliermarsh/ruff-pre-commit to v0.0.270

* chore: use new repository for `ruff-pre-commit`



Co-authored-by: renovate[bot] <29139614+renovate[bot]>
Co-authored-by: Mathieu Kniewallner <>

Git stats


Failed to load latest commit information.
Latest commit message
Commit time

deptry logo

Release Build status Supported Python versions codecov PyPI - Downloads License

deptry is a command line tool to check for issues with dependencies in a Python project, such as unused or missing dependencies. It supports the following types of projects:

  • Projects that use Poetry and a corresponding pyproject.toml file
  • Projects that use PDM and a corresponding pyproject.toml file
  • Projects that use a requirements.txt file according to the pip standards

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



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

# Install with poetry
poetry add --group 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.


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.


To scan your project for dependency issues, run:

deptry .

Example output could look as follows:

Scanning 2 files...

foo/ DEP004 'numpy' imported but declared as a dev dependency
foo/ 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.


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 section of the documentation..

Repository initiated with fpgmaas/cookiecutter-poetry.