Win 系统 conda 如何配置镜像源
通过命令添加镜像源(推荐)
以 清华源 为例,依次执行以下命令:
# 添加主镜像源
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
# 添加微软相关包镜像源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
# 添加社区维护的扩展包镜像源(如 conda-forge)
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
# 设置搜索时显示镜像地址
conda config --set show_channel_urls yes
验证配置是否生效
# 查看当前配置
conda config --show-sources
清除 Conda 缓存
更新配置后,清除旧缓存以确保使用新镜像源
conda clean -i
恢复默认配置?
# 删除所有镜像源配置
conda config --remove-key channels