uv的使用
约 114 字小于 1 分钟
2025-08-15
之前一直是用的 conda 来管理 python, 最近接触了一下uv, 一下就被其速度吸引了, 还有其对依赖的管理比 requirements.txt 更加方便.
基础使用
安装
macOS上可以使用Homebrew安装uv:
brew install uv
换源
在 ~/.config/uv/uv.toml
中添加以下内容:
[[index]]
url = "https://pypi.tuna.tsinghua.edu.cn/simple/"
default = true
指定 python 版本
uv python pin 3.11
添加包
uv add requests