Python uv 配置镜像源

Python 镜像 About 517 words

配置文件设置

pyproject.toml中配置。

清华镜像源

[[tool.uv.index]]
url = "https://pypi.tuna.tsinghua.edu.cn/simple"
default = true

交大镜像源

[[tool.uv.index]]
url = "https://mirror.sjtu.edu.cn/pypi/web/simple"
default = true

全局环境变量设置

设置UV_DEFAULT_INDEX环境变量

macOS & Linux

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

Windows

$env:UV_DEFAULT_INDEX="https://pypi.tuna.tsinghua.edu.cn/simple"

临时使用

uv add requests --index https://pypi.tuna.tsinghua.edu.cn/simple

参考文档

https://docs.astral.sh/uv/reference/environment/

Views: 9 · Posted: 2026-06-11

———         Thanks for Reading         ———

Give me a Star, Thanks:)

https://github.com/fendoudebb/LiteNote

扫描下方二维码关注公众号和小程序↓↓↓

扫描下方二维码关注公众号和小程序↓↓↓
Prev Post
Today In History
Browsing Refresh