如果你已经用过 uv,应该体会过它带来的包管理速度提升。但对国内用户来说,安装 uv 本体、下载 Python 或访问 PyPI 时仍可能被网络链路拖慢。

uv-custom 是一个为国内用户准备的 uv 加速镜像项目,提供安装脚本,并可配置下载代理、PyPI 镜像和 Python 构建镜像。

uv-custom

项目地址:

版本提示: 本文截图、安装脚本和示例版本来自 2025 年 8 月。使用前请查看项目最新 Release 和 README,确认脚本地址、镜像地址和受支持的 uv 版本。

一、uv-custom 解决什么问题

官方 uv 很快,但国内网络可能遇到三类瓶颈:

  1. 从 GitHub 下载 uv 安装包较慢;
  2. 下载 Python 解释器较慢;
  3. 访问官方 PyPI 源不稳定。

uv-custom 提供国内可访问的安装入口,并可自动配置镜像,减少网络问题。

二、快速安装

进入 Gitee Release 页面:

https://gitee.com/jumploop/uv-custom/releases

uv-custom Release

选择安装脚本

macOS / Linux

1
curl -LsSf https://gitee.com/jumploop/uv-custom/releases/download/latest/uv-installer-custom.sh | sh

安装 uv-custom

Windows PowerShell

1
powershell -ExecutionPolicy Bypass -c "irm https://gitee.com/jumploop/uv-custom/releases/download/latest/uv-installer-custom.ps1 | iex"

PowerShell 安装 uv-custom

安装前建议先打开脚本地址查看内容,确认地址可信。

三、自定义镜像和版本

可以在运行安装命令前设置环境变量:

变量用途示例
UV_DOWNLOAD_PROXY下载代理https://gh-proxy.com
UV_PYPI_MIRRORPyPI 镜像https://mirrors.aliyun.com/pypi/simple/
UV_VERSION指定 uv 版本0.7.19

macOS / Linux 示例

1
2
3
4
5
export UV_DOWNLOAD_PROXY="https://gh-proxy.com"
export UV_PYPI_MIRROR="https://mirrors.aliyun.com/pypi/simple/"
export UV_VERSION="0.7.19"

curl -LsSf https://gitee.com/jumploop/uv-custom/releases/download/latest/uv-installer-custom.sh | sh

自定义镜像安装

Windows PowerShell 示例

1
2
3
4
5
$env:UV_DOWNLOAD_PROXY="https://gh-proxy.com"
$env:UV_PYPI_MIRROR="https://mirrors.aliyun.com/pypi/simple/"
$env:UV_VERSION="0.7.19"

powershell -ExecutionPolicy Bypass -c "irm https://gitee.com/jumploop/uv-custom/releases/download/latest/uv-installer-custom.ps1 | iex"

PowerShell 自定义镜像安装

四、验证安装

安装后重新打开终端,执行:

1
uv --version

如果输出版本号,说明安装成功。之后可以继续使用 uv pip install、uv venv、uv python install 等命令。

五、供应链安全提醒

安装脚本和镜像会改变下载来源,请注意:

  1. 只使用你信任的 Gitee、GitHub、学校或企业镜像;
  2. 不要把陌生代理地址写进全局配置;
  3. 敏感项目建议在隔离环境中测试;
  4. 如果公司有统一网络策略,先确认镜像和代理是否允许使用。

总结

uv-custom 适合被国内网络环境卡住的用户。它能加速 uv 和 Python 的安装,并简化 PyPI 镜像配置。使用前请查看项目最新说明,避免用过时的脚本地址或版本参数。