# UV PyPI Mirrors for China — Ranked by Speed & Community Rating ## Top Mirrors Ranked | Rank | Mirror | URL | Throughput | Latency | Community Rating | |------|--------|-----|-----------|---------|-----------------| | 1 | **Tsinghua TUNA** | `https://pypi.tuna.tsinghua.edu.cn/simple` | ~3.3 MB/s | ~500ms | 5/5 — Best sync (15min), 99.9% completeness | | 2 | **Alibaba Cloud** | `https://mirrors.aliyun.com/pypi/simple/` | ~4.8 MB/s | ~300ms | 4/5 — CDN-backed, most stable for production | | 3 | **Huawei Cloud** | `https://repo.huaweicloud.com/repository/pypi/simple/` | **~13.6 MB/s** | Unstable | 3/5 — Fastest throughput, but occasional timeouts | | 4 | **USTC** | `https://pypi.mirrors.ustc.edu.cn/simple/` | ~0.7 MB/s | **~136ms** | 4/5 — Lowest latency, 99.9% completeness | | 5 | **Tencent Cloud** | `https://mirrors.cloud.tencent.com/pypi/simple/` | Medium | ~1253ms | 4/5 — Good in South China | | 6 | **Douban** | `https://pypi.doubanio.com/simple/` | Medium | Low | 4/5 — Aging, some outdated packages | | 7 | **NetEase** | `https://mirrors.163.com/pypi/simple/` | ~3.0 MB/s | Medium | 3/5 — Good in North China | | 8 | **Volcano Engine** | `https://mirrors.volces.com/pypi/simple/` | Unknown | Unknown | New (ByteDance) | | 9 | **BFSU** | `https://mirrors.bfsu.edu.cn/pypi/web/simple/` | Similar to TUNA | Medium | Shares TUNA backend | | 10 | **SJTU** | `https://mirror.sjtu.edu.cn/pypi/web/simple/` | Medium | Medium | Good in East China | ## Community Consensus - **Tsinghua TUNA** — Most recommended overall. 15-min sync frequency, near-complete package coverage. The default recommendation on Zhihu, CSDN, and V2EX. - **Alibaba Cloud** — Best for production/commercial use. CDN edge nodes across China give stable speeds nationwide. Fastest in benchmarks that tested from Alibaba's own infrastructure. - **Huawei Cloud** — Highest raw throughput in one benchmark (~13.6 MB/s), but unreliable — timed out in latency tests. - **USTC** — Lowest latency (~136ms), but lower throughput. Best for metadata-heavy operations. - **Regional picks**: South China → Tencent/Alibaba; North China → NetEase/Baidu; East China → Douban/SJTU. ## How to Configure UV **Important**: UV does NOT read `~/.pip/pip.conf`. You must configure it separately. ### Option 1: Environment Variables (recommended) Add to `~/.zshrc`: ```bash export UV_DEFAULT_INDEX="https://mirrors.aliyun.com/pypi/simple/" export UV_INDEX="https://pypi.tuna.tsinghua.edu.cn/simple https://pypi.org/simple" export UV_PYTHON_INSTALL_MIRROR="https://gh-proxy.com/github.com/indygreg/python-build-standalone/releases/download" ``` ### Option 2: Global Config File Create `~/.config/uv/uv.toml`: ```toml [[index]] url = "https://mirrors.aliyun.com/pypi/simple/" default = true ``` ### Option 3: Project-Level pyproject.toml ```toml [[tool.uv.index]] url = "https://mirrors.aliyun.com/pypi/simple/" default = true ``` ### Option 4: One-off Command Line ```bash uv pip install numpy --default-index https://mirrors.aliyun.com/pypi/simple/ uv add requests --default-index https://pypi.tuna.tsinghua.edu.cn/simple ``` ## Python Installation Mirror `uv python install` downloads from GitHub (blocked/slow in China). Set `UV_PYTHON_INSTALL_MIRROR` to a proxy, or use CERNET's mirror at `https://mirrors.cernet.edu.cn/list/python-build-standalone`. ## Speed Benchmarks ### Latency Test (cnpip tool) | Mirror | Latency | |--------|---------| | USTC | 135.71 ms | | Alibaba Cloud | 300.77 ms | | Tsinghua TUNA | 499.51 ms | | Default PyPI | 1252.75 ms | | Tencent Cloud | ~1253 ms | | Huawei Cloud | Timeout | ### Download Throughput (1,014 MB package install, China Telecom) | Mirror | Test 1 | Test 2 | Test 3 | Average | |--------|--------|--------|--------|---------| | Huawei Cloud | 12.0 MB/s | 15.8 MB/s | 13.1 MB/s | ~13.6 MB/s | | Alibaba Cloud | 5.8 MB/s | 2.6 MB/s | 5.9 MB/s | ~4.8 MB/s | | Tsinghua TUNA | 8.2 MB/s | 0.5 MB/s | 1.1 MB/s | ~3.3 MB/s | | NetEase | 2.3 MB/s | 5.5 MB/s | 1.3 MB/s | ~3.0 MB/s | | USTC | 0.4 MB/s | 1.0 MB/s | 0.7 MB/s | ~0.7 MB/s | ## Verdict **Tsinghua + Alibaba as primary/fallback** is the safest combo for most users in China. Test from your specific location with [cnpip](https://github.com/caoergou/cnpip) for personalized results, since speed varies heavily by ISP and region. ## Sources - [CSDN: UV mirror configuration guide](https://blog.csdn.net/qq_41472205/article/details/145686414) - [Zhihu: UV mirror acceleration](https://zhuanlan.zhihu.com/p/1930714592423703026) - [V2EX: UV domestic mirror discussion](https://www.v2ex.com/t/1095023) - [CSDN: PyPI mirror speed test](https://blog.csdn.net/a496298685/article/details/144198111) - [CSDN: 8 PyPI mirror comparison](https://blog.csdn.net/2501_93878733/article/details/153830591) - [GitHub: UV Issue #6925](https://github.com/astral-sh/uv/issues/6925) - [GitHub: UV Issue #9048](https://github.com/astral-sh/uv/issues/9048) - [GitHub: cnpip speed tester](https://github.com/caoergou/cnpip)