使用.condarc对Anaconda更换国内镜像

本文详细介绍了如何通过修改.condarc配置文件,更换conda的软件包源为清华大学的镜像源,包括具体步骤和示例配置,帮助提升软件包下载速度。
部署运行你感兴趣的模型镜像

配置文件 .condarc是conda应用程序的配置文件在用户的家目录(windows:C:\users\username\)

对于.condarc配置文件,是一种可选的(optional)运行配置文件,其默认情况下是不存在的,但当用户第一次运行 conda config命令时,将会在用户的家目录创建该文件。

更换国内源

1.查看源conda config --show-sources

2.更换国内源:(可以直接在C盘用户目录下搜索.condarc,用记事本打开,将里面的内容更改为如下内容)

channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/menpo/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
  - defaults
show_channel_urls: true

3.如图
在这里插入图片描述
4.删源
换回conda的默认源。查看了conda config的文档后,发现直接删除channels即可。

conda config --remove-key channels

https://blog.youkuaiyun.com/observador/article/details/83618540

您可能感兴趣的与本文相关的镜像

Python3.8

Python3.8

Conda
Python

Python 是一种高级、解释型、通用的编程语言,以其简洁易读的语法而闻名,适用于广泛的应用,包括Web开发、数据分析、人工智能和自动化脚本

(base) [root@master ~]# vim ~/.condarc (base) [root@master ~]# conda config --remove-keys channels # 先清除现有通道配置 ://mirrors.aliyun.com/anaconda/pkgs/r conda config --add channels https://mirrors.aliyun.com/anaconda/pkgs/msys2usage: conda [-h] [-v] [--no-plugins] [-V] COMMAND ... conda: error: unrecognized arguments: --remove-keys channels (base) [root@master ~]# conda config --add channels https://mirrors.aliyun.com/anaconda/cloud/conda-forge Warning: 'https://mirrors.aliyun.com/anaconda/cloud/conda-forge' already in 'channels' list, moving to the top (base) [root@master ~]# conda config --add channels https://mirrors.aliyun.com/anaconda/pkgs/main Warning: 'https://mirrors.aliyun.com/anaconda/pkgs/main' already in 'channels' list, moving to the top (base) [root@master ~]# conda config --add channels https://mirrors.aliyun.com/anaconda/pkgs/r Warning: 'https://mirrors.aliyun.com/anaconda/pkgs/r' already in 'channels' list, moving to the top (base) [root@master ~]# conda config --add channels https://mirrors.aliyun.com/anaconda/pkgs/msys2 Warning: 'https://mirrors.aliyun.com/anaconda/pkgs/msys2' already in 'channels' list, moving to the top (base) [root@master ~]# cat ~/.condarc channels: - https://mirrors.aliyun.com/anaconda/pkgs/msys2 - https://mirrors.aliyun.com/anaconda/pkgs/r - https://mirrors.aliyun.com/anaconda/pkgs/main - https://mirrors.aliyun.com/anaconda/cloud/conda-forge (base) [root@master ~]# conda clean -a --force Will remove 1 package cache(s). Proceed ([y]/n)? y (base) [root@master ~]# conda config --show channels channels: - https://mirrors.aliyun.com/anaconda/pkgs/msys2 - https://mirrors.aliyun.com/anaconda/pkgs/r - https://mirrors.aliyun.com/anaconda/pkgs/main - https://mirrors.aliyun.com/anaconda/cloud/conda-forge - https://repo.anaconda.com/pkgs/main - https://repo.anaconda.com/pkgs/r (base) [root@master ~]# anaconda怎么换源,默认源一直存在
08-12
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值