4
社区成员
发帖
与我相关
我的任务
分享| 镜像站名称 | 主要同步内容 | 主页地址 | 特点与使用频率 |
|---|---|---|---|
| 清华大学 TUNA 镜像站 | 全品类(PyPI, Conda, Docker Hub, Ubuntu, 等) | https://mirrors.tuna.tsinghua.edu.cn/ | 国内最著名、最全面的镜像站之一,稳定性好,文档详细,强烈推荐为首选。 |
| 阿里云开源镜像站 | 全品类(PyPI, Maven, npm, Docker, 等) | https://developer.aliyun.com/mirror/ | 由阿里云维护,速度极快、节点多、稳定性高,同样是首选之一。 |
| 华为云开源镜像站 | 全品类(PyPI, 系统发行版, 语言仓库) | https://mirrors.huaweicloud.com/ | 华为云维护,速度优秀,同样非常可靠。 |
| 中科大 USTC 镜像站 | 全品类(PyPI, Anaconda, Linux发行版, 等) | https://mirrors.ustc.edu.cn/ | 历史悠久,口碑极佳,是许多开发者的“启蒙”镜像站。 |
| 豆瓣 PyPI 镜像 | 专精 PyPI (Python包) | https://pypi.doubanio.com/simple/ | 老牌的PyPI专用镜像,速度稳定,在Python开发者中知名度很高。 |
| 腾讯云开源镜像站 | 全品类 | https://mirrors.cloud.tencent.com/ | 腾讯云维护,与云服务集成好,适合腾讯云用户。 |
| 网易开源镜像站 | 全品类 | http://mirrors.163.com/ | 网易维护,历史也很悠久,访问速度不错。 |
镜像站的使用主要体现在 “换源” ,即修改你工具的下载源地址。以下是几种最常见的使用场景:
1. 为 pip (Python包管理器) 换源
这是最常用的场景,可以极大加速 pip install。
临时使用(单次安装):
bash
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package
永久设置(推荐):
bash
# Linux/macOS pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple # 或编辑配置文件 ~/.pip/pip.conf,写入: [global] index-url = https://pypi.tuna.tsinghua.edu.cn/simple trusted-host = pypi.tuna.tsinghua.edu.cn # Windows # 在用户目录(如 C:\Users\你的用户名)下创建 pip 文件夹,再创建 pip.ini 文件,内容同上。
2. 为 conda 换源
如果你是 Anaconda 或 Miniconda 用户,换源同样重要。
bash
# 设置清华conda镜像(一次性执行) conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/ conda config --set show_channel_urls yes # 设置清华的conda-forge通道(如需) conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
3. 为 Docker 换源
加速拉取 Docker 镜像。
编辑或创建 Docker 配置文件 /etc/docker/daemon.json (Linux/macOS) 或 Docker Desktop 的 Settings -> Docker Engine (Windows/macOS GUI):
json
{
"registry-mirrors": [
"https://docker.mirrors.ustc.edu.cn",
"https://hub-mirror.c.163.com"
]
}