uv (极速Python包与项目管理器)
91,942
Stars
3,809
Forks
246
Watchers
3,076
Open Issues
Apache-2.0
许可证
Rust
语言
2023-10-02
创建时间
2026-11-12
最近更新
项目能做什么
使用 Rust 编写的极速 Python 包与项目管理工具。
来源:AI 基于仓库事实生成
· 内容以仓库实际 README 为准
使用说明 查看原始 README 原仓库文档
项目简介
uv 是一个用 Rust 编写的极快 Python 包和项目管理器,由 Astral(Ruff 和 ty 的开发团队)支持。它支持 macOS、Linux 和 Windows,无需预先安装 Rust 或 Python 即可通过独立脚本安装使用。
核心功能
- 一站式工具替代:用一个工具替代
pip、pip-tools、pipx、poetry、pyenv、twine、virtualenv等传统工具,速度比pip快 10–100 倍。 - 项目管理:提供完整的项目依赖与环境管理,支持通用 lockfile 和 Cargo 风格的 workspaces,并支持项目构建与发布。常用命令:
console uv init example # 初始化项目 uv add ruff # 添加依赖并自动创建虚拟环境 (.venv) uv run ruff check # 在项目环境中运行命令 uv lock # 生成/更新 lockfile uv sync # 同步依赖环境 - 单文件脚本支持:支持为单文件脚本添加内联依赖元数据,并在隔离的虚拟环境中直接运行:
console uv add --script example.py requests # 为脚本声明依赖 uv run example.py # 在隔离环境中运行脚本 - 工具运行与安装:类似
pipx,支持运行和安装 Python 包提供的命令行工具:console uvx pycowsay 'hello world!' # 在临时环境中运行工具(uv tool run 的别名) uv tool install ruff # 全局安装工具 - Python 版本管理:支持安装并快速切换多个 Python 版本:
console uv python install 3.12 3.13 3.14 - pip 兼容与全局缓存:提供与
pip兼容的 CLI 接口,并通过全局缓存(global cache)对依赖进行去重,节省磁盘空间。
适合谁用
适合需要管理 Python 依赖、虚拟环境、多版本 Python、单文件脚本或命令行工具的 Python 开发者。
安装步骤
方式一:使用独立安装脚本(推荐,无需 Rust 或 Python)
- macOS 和 Linux:
bash curl -LsSf https://astral.sh/uv/install.sh | sh - Windows:
bash powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
通过独立安装脚本安装后,可使用以下命令更新到最新版本:
uv self update
方式二:从 PyPI 安装
- 使用
pip:bash pip install uv - 或使用
pipx:bash pipx install uv
配置说明
此部分原文未说明,请查看原仓库(完整文档可访问 docs.astral.sh/uv,或运行 uv help 查看命令行参考)。
常见问题
此部分原文未说明,请查看原仓库。
原始 README 摘录(英文原文,节选前 3000 字符)
# uv
<a href="https://pypi.python.org/pypi/uv"><img src="https://img.shields.io/pypi/v/uv.svg" alt="Latest PyPI version" /></a>
<a href="https://pypi.python.org/pypi/uv"><img src="https://img.shields.io/pypi/pyversions/uv.svg" alt="Supported Python versions" /></a>
<a href="https://discord.gg/astral-sh"><img src="https://img.shields.io/badge/Discord-%235865F2.svg?logo=discord&logoColor=white" alt="Discord" /></a>
An extremely fast Python package and project manager, written in Rust.
<p align="center">
<picture align="center">
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/astral-sh/uv/assets/1309177/03aa9163-1c79-4a87-a31d-7a9311ed9310">
<source media="(prefers-color-scheme: light)" srcset="https://github.com/astral-sh/uv/assets/1309177/629e59c0-9c6e-4013-9ad4-adb2bcf5080d">
<img alt="Shows a bar chart with benchmark results." src="https://github.com/astral-sh/uv/assets/1309177/629e59c0-9c6e-4013-9ad4-adb2bcf5080d">
</picture>
</p>
<p align="center">
<i>Installing <a href="https://trio.readthedocs.io/">Trio</a>'s dependencies with a warm cache.</i>
</p>
## Highlights
- A single tool to replace `pip`, `pip-tools`, `pipx`, `poetry`, `pyenv`, `twine`, `virtualenv`, and
more.
- [10-100x faster](https://github.com/astral-sh/uv/blob/main/BENCHMARKS.md) than `pip`.
- Provides [comprehensive project management](#projects), with a
[universal lockfile](https://docs.astral.sh/uv/concepts/projects/layout#the-lockfile).
- [Runs scripts](#scripts), with support for
[inline dependency metadata](https://docs.astral.sh/uv/guides/scripts#declaring-script-dependencies).
- [Installs and manages](#python-versions) Python versions.
- [Runs and installs](#tools) tools published as Python packages.
- Includes a [pip-compatible interface](#the-pip-interface) for a performance boost with a familiar
CLI.
- Supports Cargo-style [workspaces](https://docs.astral.sh/uv/concepts/projects/workspaces) for
scalable projects.
- Disk-space efficient, with a [global cache](https://docs.astral.sh/uv/concepts/cache) for
dependency deduplication.
- Installable without Rust or Python via `curl` or `pip`.
- Supports macOS, Linux, and Windows.
uv is backed by [Astral](https://astral.sh), the creators of
[Ruff](https://github.com/astral-sh/ruff) and [ty](https://github.com/astral-sh/ty).
## Installation
Install uv with our standalone installers:
```bash
# On macOS and Linux.
curl -LsSf https://astral.sh/uv/install.sh | sh
```
```bash
# On Windows.
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
```
Or, from [PyPI](https://pypi.org/project/uv/):
```bash
# With pip.
pip install uv
```
```bash
# Or pipx.
pipx install uv
```
If installed via the standalone installer, uv can update itself to the latest version:
```bash
uv self update
```
See the [installation documentation](https://docs.astral.sh/uv/getting-started/installation/) for
details and alternative installation methods.
## Documen
阅读完整原文
项目深度分析 AI 生成
面向 CI/CD 的 uv 远程共享缓存服务 (Remote Cache as a Service)
| 产品构想 | 利用 uv 全局缓存与高效解析特性,为企业 CI/CD(GitHub Actions, GitLab CI 等)提供端到端开箱即用的远程依赖缓存代理,进一步缩短流水线执行时间并节省带宽。 |
| 核心功能 | S3/云存储背后的低延迟读写代理、跨 runner 缓存命中优化、哈希感知拉取、CI 配置一键集成脚本、团队带宽与耗时监控仪表盘。 |
| 目标用户 | 拥有大型 Python 代码库或 monorepo 的中大型工程团队、DevOps 工程师。 |
| 难度/周期 | 中等 · 1-2 个月 · 成本:对象存储与边缘 CDN 带宽成本、多区域服务器费用。 |
| 收费模式 | 按传输流量/存储用量订阅,或按席位基础月费阶梯计费(SaaS)。 |
| 竞争风险 | Astral 官方未来可能自研第一方云缓存服务;主流云 CI 自身附带原生 cache 机制(尽管效率较低)。 |
| 依据 | 已验证事实 |
uv 驱动的企业级内部私有 PyPI 仓库与安全网关
| 产品构想 | 针对企业内网环境构建高性能包分发代理与合规网关,深度适配 uv 的 lockfile 和快速解析协议,集成漏洞扫描(CVE)与许可证审计。 |
| 核心功能 | PyPI 上游镜像与本地私有包发布(兼容 uv publish)、按策略拦截高危依赖、依赖锁文件合规自动化审查、企业 SSO 登录。 |
| 目标用户 | 金融、医疗等强合规企业安全合规团队、基础设施负责人。 |
| 难度/周期 | 高 · 3-4 个月 · 成本:大容量高可用存储、安全漏洞数据库授权费用、企业支持服务成本。 |
| 收费模式 | 企业私有化部署授权费、按节点/团队规模的年度商业许可 (On-premise/SaaS)。 |
| 竞争风险 | 面临 JFrog Artifactory、AWS CodeArtifact 等成熟巨头的直接竞争;自研私有仓库壁垒较高。 |
| 依据 | 数据支持的判断 |
单文件 Python 脚本分发与一键部署平台 (基于 PEP 723)
| 产品构想 | 围绕 uv 对内联依赖脚本(PEP 723)的原生支持,打造轻量级自动化任务托管与 Webhook 运行平台,直接黏贴单文件脚本即可一键生成云端 API 或定时任务。 |
| 核心功能 | 基于 uv 极速拉取并启动隔离沙盒运行单文件、自动化暴露 HTTP 端点、Cron 定时执行、运行日志与告警。 |
| 目标用户 | 数据分析师、自动化运维人员、写小型自动化工具的独立开发者。 |
| 难度/周期 | 中等 · 1.5-2.5 个月 · 成本:无服务器或轻量容器实例集群算力成本。 |
| 收费模式 | 免费额度 + 超过执行时长/调用次数按量付费(类似 Modal 或 Deno Deploy)。 |
| 竞争风险 | 市场上有 Modal、Modal/Modal-like 及传统 Serverless 替代品,受众偏轻量级,ARPU 较低。 |
| 依据 | AI推测 |
AI 基于仓库公开数据分析生成,含推测成分,不构成收益承诺。
报告会保存到 个人中心
竞品与相似项目 GitHub Search 真实检索
相似项目数据正在完善中,暂不展示(避免误导)
项目优势与风险
| 技术成熟度 | 创建于 2023-10-02,近 30 天仍在推送,发布过 100 个 Release |
| 社区活跃 | Star 91,942 / Fork 3,809 / Issue 3,076(数据支持,可自行核实) |
| 许可证 | Apache-2.0 |
| 主要风险 | 上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价 |
安装与使用
此项目未提供 Docker 镜像,安装步骤以原仓库 README 为准(涉及依赖安装与环境配置,对新手门槛较高)。