博主头像
请叫我仓鼠阁下

Never forget why you started!

UV

An extremely fast Python package and project manager, written in Rust.

Resources

Install

curl -LsSf https://astral.sh/uv/install.sh | sh

Update

uv self update

国内加速

export UV_DEFAULT_INDEX=https://pypi.tuna.tsinghua.edu.cn/simple

Install Python

uv python install 3.13

Usage

- Create a new Python project in the current directory:
uv init

- Create a new Python project in a directory with the given name:
uv init project_name

- Create a environment
uv venv -p 3.13

- Add a new package to the project:
uv add package

- Remove a package from the project:
uv remove package

- Run a script in the project's environment:
uv run path/to/script.py

- Run a command in the project's environment:
uv run command

- Update a project's environment from pyproject.toml:
uv sync

- Create a lock file for the project's dependencies:
uv lock
UV
https://lordhamster.com/archives/17/
本文作者 请叫我仓鼠阁下
发布时间 2025-04-03
许可协议 CC BY-NC-SA 4.0
发表新评论