国外官方源直连慢是常态,换镜像源是最立竿见影的优化。下面这些镜像都由大厂或高校长期维护,2026 年依然稳定可用。
Python / pip
- 清华 PyPI 镜像:https://mirrors.tuna.tsinghua.edu.cn/help/pypi/
临时使用:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple 包名
永久生效:pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple - 阿里云 PyPI 镜像:https://developer.aliyun.com/mirror/pypi
Node.js / npm
- npmmirror(原淘宝镜像):https://npmmirror.com/
npm config set registry https://registry.npmmirror.com - 华为云 npm 镜像:https://mirrors.huaweicloud.com/
- 官方 registry(查包必用):https://www.npmjs.com/
Java / Maven
- Maven 中央仓库检索:https://mvnrepository.com/
- 华为云 Maven 镜像:https://mirrors.huaweicloud.com/
- 阿里云 Maven 镜像:https://developer.aliyun.com/mirror/maven
Docker
- Docker Hub 官方镜像库:https://hub.docker.com/
- 清华镜像站(含 docker-ce、epel 等):https://mirrors.tuna.tsinghua.edu.cn/
小提示:换源后如果装包报证书错误,多半是公司网络做了 HTTPS 拦截,用
pip config set global.trusted-host pypi.tuna.tsinghua.edu.cn之类的配置放行即可。
楼主 · 2026-09-28 12:28 · 浏览 2

