miniconda更换镜像源
时间: 2025-01-23 13:56:47 浏览: 197
### 配置 Miniconda 使用国内镜像源
为了提高包下载速度并优化用户体验,在 `.condarc` 文件中配置国内镜像源是一个有效的方法。对于希望使用清华大学或上海交通大学镜像源的用户来说,具体方法如下:
#### 清华大学镜像源配置
编辑 `~/.condarc` 文件,添加默认通道和自定义通道指向清华大学镜像地址[^1]。
```yaml
default_channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r/
custom_channels:
conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/
pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/
channels:
- defaults
ssl_verify: true
show_channel_urls: true
```
#### 上海交通大学镜像源配置
同样地,修改 `~/.condarc` 文件来指定上交大的Anaconda仓库路径[^2]。
```yaml
default_channels:
- https://mirror.sjtu.edu.cn/anaconda/pkgs/main
- https://mirror.sjtu.edu.cn/anaconda/pkgs/r
custom_channels:
conda-forge: https://mirror.sjtu.edu.cn/anaconda/cloud/
pytorch: https://mirror.sjtu.edu.cn/anaconda/cloud/
channels:
- defaults
```
完成上述任一方式后,重启终端使新设置生效。此时再执行 `conda update --all` 或安装其他软件包时将会自动从所选的国内镜像站获取资源,从而加快下载速度并提升效率[^3]。
阅读全文
相关推荐


















