【python】使用uv管理项目包依赖

uv相关


优势

  • 并行下载
  • 本地缓存
  • 集合多种功能
  • 借鉴cargo设计
  • rust 编写

安装

复制代码
pip install uv
brewinstall uv
winget install --id=astral-sh.uv -e

管理项目

复制代码
uv init my_project
uv add unsloth==2025.10.1
uv run main.py
 #  	安装 pyproject.toml里的依赖
uv sync

管理工具

复制代码
uv tool install vllm==0.10.0
uv tool uninstall vllm
uv tool list

管理脚本

复制代码
uv init --script main.py
uv run main.py

换源

复制代码
[[tool.uv.index]]
url = "https://pypi.tuna.tsinghua.edu.cn/simple"
default = true
相关推荐
helloweilei1 天前
python 抽象基类
python
用户8356290780511 天前
Python 实现 PPT 转 HTML
后端·python
Johny_Zhao1 天前
centos7安装部署openclaw
linux·人工智能·信息安全·云计算·yum源·系统运维·openclaw
haibindev1 天前
在 Windows+WSL2 上部署 OpenClaw AI员工的实践与踩坑
linux·wsl2·openclaw
zone77391 天前
004:RAG 入门-LangChain读取PDF
后端·python·面试
zone77391 天前
005:RAG 入门-LangChain读取表格数据
后端·python·agent
树獭非懒2 天前
AI大模型小白手册|Embedding 与向量数据库
后端·python·llm
唐叔在学习2 天前
就算没有服务器,我照样能够同步数据
后端·python·程序员
曲幽2 天前
FastAPI流式输出实战与避坑指南:让AI像人一样“边想边说”
python·ai·fastapi·web·stream·chat·async·generator·ollama