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 httpxCommon 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 requestsRelated guides
poetry add: Add a Dependency and Re-lockHow poetry add installs a dependency, updates pyproject.toml and poetry.lock, the --group and --dev usage, an…
poetry install: Install from the LockfileHow poetry install resolves and installs dependencies from poetry.lock, the --no-root and --only flags useful…
poetry show: Inspect Installed DependenciesHow poetry show lists project dependencies and versions, the --tree and --outdated flags for auditing, and ho…