← 返回命令列表

Linux command

uv-remove 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Remove dependency

uv remove [package]

Remove dev dependency

uv remove --dev [package]

Remove from optional group

uv remove --optional [group] [package]

说明

uv remove removes dependencies from a Python project. Updates pyproject.toml and uv.lock. Automatically syncs the virtual environment.

参数

--dev
Remove the package from the tool.uv.dev-dependencies group.
--optional _GROUP_
Remove from the named optional dependency group in pyproject.toml.
--group _GROUP_
Remove from the named PEP 735 dependency group.
--script _SCRIPT.PY_
Operate on the dependency block of a single-file PEP 723 script instead of the project.
--package _PACKAGE_
In a workspace, target the package member named _PACKAGE_.
--frozen
Update pyproject.toml but leave uv.lock unchanged.
--locked
Fail if uv.lock would need to change (CI guard).
--no-sync
Skip syncing the project's virtual environment after the change.

FAQ

What is the uv-remove command used for?

uv remove removes dependencies from a Python project. Updates pyproject.toml and uv.lock. Automatically syncs the virtual environment.

How do I run a basic uv-remove example?

Run `uv remove [package]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --dev do in uv-remove?

Remove the package from the tool.uv.dev-dependencies group.