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

应无输出结果。

相关推荐
伞伞悦读2 天前
【第39期】Python 第三方包安装详解:pip、conda、requirements、版本锁定和镜像源
python·conda·pip
梦想不只是梦与想4 天前
环境管理:Conda 与 venv
python·conda·uv
梦想不只是梦与想6 天前
环境管理系统:Conda(一)
python·conda·环境隔离
Blockbuater_drug6 天前
Protenix: conda 环境部署、零基础安装
conda·开源模型·字节跳动·v2·蛋白结构预测·protenix
AlfredZhao7 天前
执行新项目 python 脚本前,先用 conda 建一个独立环境
conda
THe CHallEnge of THe BrAve11 天前
conda虚拟环境打包离线迁移
conda
basketball61617 天前
AI Infra 配置 Conda + CUDA + LibTorch + PyTorch 开发环境:解决版本漂移、编译报错的完整指南
人工智能·pytorch·conda·libtorch
公爵爱学习17 天前
无人机视觉识别前序-Linux-YOLO安装
python·yolo·计算机视觉·conda·无人机
长江后浪博客24 天前
Conda环境下测试Intel NPU:Python版本如何选择?
开发语言·python·conda·openvino·intel npu
伞伞悦读1 个月前
【第12期】Windows 开发环境备份与恢复:软件、环境变量、Git、conda 和 Docker 卷完整方案
git·docker·conda