conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/ # 添加阿里云镜像源conda config --add channels https://mirrors.aliyun.com/anaconda/pkgs/free/conda config --add channels https://mirrors.aliyun.com/anaconda/pkgs/main/
时间: 2025-04-06 17:04:35 浏览: 40
### 添加清华大学 TUNA 和阿里云 Anaconda 镜像源
为了加速 `conda` 的包管理操作,可以通过配置命令行工具来添加清华大学 TUNA 和阿里云的镜像源。以下是具体的操作方法:
#### 清华大学 TUNA 镜像源配置
可以使用以下命令将清华大学 TUNA 镜像源添加到 `conda` 中:
```bash
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
```
同时设置显示通道 URL 功能以便确认使用的镜像源是否生效:
```bash
conda config --set show_channel_urls yes
```
以上命令会将指定的两个频道依次加入到用户的 `.condarc` 文件中[^1]。
#### 阿里云镜像源配置
对于阿里云的镜像源,同样需要执行类似的命令将其添加至 `channels` 列表中:
```bash
conda config --add channels https://mirrors.aliyun.com/anaconda/pkgs/main/
conda config --add channels https://mirrors.aliyun.com/anaconda/pkgs/free/
```
并确保开启显示通道 URL 设置以验证安装过程中的来源信息准确性:
```bash
conda config --set show_channel_urls yes
```
此部分来源于针对国内用户优化过的第三方镜像站点之一——阿里云开源镜像站[^3]。
#### 查看当前已配置的所有 channel
完成上述两步之后,可通过下面这条指令查看目前所有的 sources 是否成功加入了新的镜像链接地址列表之中:
```bash
conda config --show channels
```
这一步骤有助于检验之前所做的更改是否正确无误地反映出来[^2]。
通过这些步骤即可有效提升基于 Conda 进行软件环境构建时的速度表现以及稳定性保障。
阅读全文
相关推荐



















