macOS 下 .config/uv/uv.toml內
pip源
[[index]]
url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/"
default = true#uv python install 下載源配置無效,需要在項目里配置
# python-install-mirror = "https://mirror.nju.edu.cn/github-release/indygreg/python-build-standalone"
uv python install
源最開始是 我永遠喜歡墨小菊找到的
需要在項目的pyproject.toml里配置。如:
**文件: pyproject.toml**
[project]
name = "test"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = "~=3.10"
dependencies = ["flask>=3.1.1","requests>=2.32.3",
]
[tool.uv]
#python-install-mirror = "https://mirror.nju.edu.cn/github-release/indygreg/python-build-standalone" 南京大學
python-install-mirror = "https://registry.npmmirror.com/-/binary/python-build-standalone/" # 阿里源**文件:.python-version 內版本對應**
3.10執行uv sync 會自動把Python=3.10下載在pyproject.toml同目錄下可以執行uv python install 3.9 3.10 3.11 3.12 等多版本下載,python-install-mirror在這可以生效