conda中设置镜像地址(附所有可换的地址)

Conda 镜像配置


✅ 通用:先清空所有 channel 相关配置

在设置任一镜像前,请运行以下命令清除旧配置:

bash 复制代码
conda config --remove-key channels
conda config --remove-key default_channels
conda config --remove-key show_channel_urls
conda config --remove-key ssl_verify

这会彻底清除所有 channel 与相关设置,确保配置干净无残留。


1️⃣ 阿里云镜像配置(仅 channels)

bash 复制代码
conda config --add channels https://mirrors.aliyun.com/anaconda/pkgs/main
conda config --add channels https://mirrors.aliyun.com/anaconda/pkgs/r
conda config --add channels https://mirrors.aliyun.com/anaconda/pkgs/msys2
conda config --set show_channel_urls yes

2️⃣ 中科大(USTC)镜像配置(仅 channels)

bash 复制代码
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/
conda config --set show_channel_urls yes
conda config --set ssl_verify true

3️⃣ 上海交大(SJTUG)镜像配置(仅 channels)

bash 复制代码
conda config --add channels https://mirrors.sjtug.sjtu.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.sjtug.sjtu.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.sjtug.sjtu.edu.cn/anaconda/cloud/conda-forge/
conda config --set show_channel_urls yes
conda config --set ssl_verify true

4️⃣ 清华大学(TUNA)镜像配置(仅 channels,推荐)

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/r
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
conda config --set show_channel_urls yes

🔍 验证当前配置

设置完成后,检查生效情况:

bash 复制代码
conda config --show channels
conda config --show show_channel_urls

若想查看是否已成功移除 default_channels,运行:

bash 复制代码
conda config --show | grep default_channels

应无输出结果。

相关推荐
兮希yxx6 小时前
conda配置pytorch虚拟环境
人工智能·pytorch·conda
淬炼之火3 天前
pycharm无法添加本地conda解释器/命令行激活conda时出现很多无关内容
ide·人工智能·pycharm·conda
小李小李无与伦比3 天前
MinerU环境部署——PDF转Markdown
开发语言·python·深度学习·conda
sniper_fandc4 天前
Anaconda安装与conda使用详细版
pycharm·conda·anaconda
qq_172805594 天前
Python3环境搭建教程 - 使用Conda工具
conda
huan_19935 天前
Conda相关的用法
conda·python包管理·conda命令·conda简单实用·conda案例
水母哟 ( ̄^ ̄)ゞ9 天前
Anaconda安装报错记录“usage: conda-script.py [-h] [--no-plugins] [-v] command
conda
Johny_Zhao10 天前
Conda、Anaconda、Miniconda对比分析
linux·网络安全·信息安全·kubernetes·云计算·conda·shell·containerd·anaconda·yum源·系统运维·miniconda
zhanghongyi_cpp11 天前
linux的conda配置与应用阶段的简单指令备注
linux·python·conda