pyproject.toml.
Usage
Description
Remove dependencies from the project’spyproject.toml file.
If multiple entries exist for a given dependency (i.e., each with different markers), all of the entries will be removed.
The lockfile and project environment will be updated to reflect the removed dependencies. To skip updating the lockfile, use --frozen. To skip updating the environment, use --no-sync.
If any of the requested dependencies are not present in the project, uv will exit with an error.
If a package has been manually installed in the environment (i.e., with uv pip install), it will not be removed by uv remove.
uv will search for a project in the current directory or any parent directory. If a project cannot be found, uv will exit with an error.
Arguments
The names of the dependencies to remove (e.g.,
ruff).Packages are specified by name, not as full PEP 508 requirements.Options
Dependency Groups
--dev
Remove the packages from the development dependency group.This option is an alias for
--group dev.Environment variable: UV_DEVRemove the packages from the project’s optional dependencies for the specified extra.
Remove the packages from the specified dependency group.
Syncing Options
--no-sync
Avoid syncing the virtual environment after re-locking the project.Environment variable:
UV_NO_SYNCLocking 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
Remove dependencies without re-locking the project.The project environment will not be synced.Environment variable:
UV_FROZENWorkspace Options
Remove the dependencies from a specific package in the workspace.
Remove the dependency from the specified Python script, rather than from a project.If provided, uv will remove the dependency from the script’s inline metadata table, in adherence with PEP 723.
Environment Options
--active
Prefer the active virtual environment over the project’s virtual environment.If the project virtual environment is active or no virtual environment is active, this has no effect.
The Python interpreter to use for resolving and syncing.See
Environment variable:
uv help python for details on Python discovery and supported request formats.Short form: -pEnvironment variable:
UV_PYTHONExamples
Remove a single package
Remove multiple packages
Remove a development dependency
Remove from an optional dependency group
Remove from a custom dependency group
Remove without syncing
pyproject.toml and updates the lockfile, but doesn’t modify the environment. Run uv sync later to apply changes.