conda换源北外
时间: 2025-04-26 16:10:14 浏览: 18
### 更改 Conda 镜像源至北京外国语大学
为了更改 Conda 的默认镜像源到北京外国语大学提供的镜像,可以按照如下方法操作:
编辑或创建 `.condarc` 文件来指定新的镜像地址。此配置文件通常位于用户的根目录下 `/root/.condarc` 或者对于普通用户则是 `~/.condarc`[^1]。
具体命令如下所示:
```bash
vim ~/.condarc
```
在打开的 `.condarc` 文件中输入以下内容以指向北京外国语大学的 Anaconda 镜像服务:
```yaml
channels:
- https://mirrors.bfsu.edu.cn/anaconda/pkgs/main/
- https://mirrors.bfsu.edu.cn/anaconda/pkgs/free/
- defaults
show_channel_urls: true
default_channels:
- https://mirrors.bfsu.edu.cn/anaconda/pkgs/main
- https://mirrors.bfsu.edu.cn/anaconda/pkgs/r
custom_channels:
conda-forge: https://mirrors.bfsu.edu.cn/anaconda/cloud
msys2: https://mirrors.bfsu.edu.cn/anaconda/cloud
bioconda: https://mirrors.bfsu.edu.cn/anaconda/cloud
menpo: https://mirrors.bfsu.edu.cn/anaconda/cloud
pytorch: https://mirrors.bfsu.edu.cn/anaconda/cloud
simpleitk: https://mirrors.bfsu.edu.cn/anaconda/cloud
```
保存并关闭文件后,更新当前环境使新设置生效:
```bash
conda clean -i
conda update --all
```
通过上述步骤完成对 Conda 使用北京外国语大学镜像源的切换工作[^3]。
阅读全文
相关推荐

















