Skip to content
Latchkey

poetry remove: Remove a Dependency

Drop a dependency and re-lock in one step.

poetry remove uninstalls a package, removes it from pyproject.toml, and updates the lockfile. It keeps the manifest and lock consistent the way manual edits do not.

What it does

Removes the named dependency from the project manifest and lockfile, then uninstalls it from the environment. Target a specific group with --group.

Common usage

Terminal
poetry remove requests
poetry remove --group dev pytest
poetry remove requests httpx

Common CI error: not a dependency

If the package is not declared in pyproject.toml (or is in a different group), poetry remove errors. Check the group and the exact name from pyproject.toml.

Terminal
# Failure:
# The following packages were not found: requests

# Fix: target the right group
poetry remove --group dev requests

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →