conda临时使用清华源
时间: 2025-02-16 20:16:36 浏览: 244
如果你想要在使用Anaconda或Miniconda时临时切换到清华大学的镜像源,以便更快地下载软件包,可以按照以下步骤操作:
1. 打开命令行终端或Anaconda Prompt。
2. 首先,检查当前使用的默认镜像源。你可以运行以下命令:
```
conda config --get channels
```
3. 确认已添加官方源`defaults`。如果没有,你需要添加它:
```
conda config --add channels defaults
```
4. 接下来,关闭并更新现有的环境配置,使其使用清华大学源。输入:
```
conda config --set channel_priority strict
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/cloud/menpo
```
这里`https://mirrors.tuna.tsinghua.edu.cn/anaconda/...`替换成相应的清华大学镜像地址。
5. 完成上述设置后,重启Anaconda Prompt,新配置才会生效。现在你可以使用`conda install`命令安装软件包了,速度可能会有所提升。
6. 当你完成对特定项目的安装后,如果你想恢复回默认源,可以将`https://mirrors.tuna.tsinghua.edu.cn/anaconda/...`从`channels`列表中移除,并再次运行上述`conda config`命令来清除临时更改。
阅读全文
相关推荐

















