conda | 设置软件源

目录

 

添加channels,以腾讯云为例

移除源

打印当前的channels

系统中的配置文件


添加channels,以腾讯云为例

腾讯源

conda config --add channels https://mirrors.cloud.tencent.com/anaconda/pkgs/free/

conda config --add channels https://mirrors.cloud.tencent.com/anaconda/pkgs/main/

conda config --add channels https://mirrors.cloud.tencent.com/anaconda/cloud/conda-forge/

conda config --add channels https://mirrors.cloud.tencent.com/anaconda/cloud/pytorch/

conda config --add channels https://mirrors.cloud.tencent.com/anaconda/pkgs/pro/

清华源

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/main/

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/

conda config --add channels ht

### 如何配置 Conda 使用默认镜像 为了使 Conda 能够高效获取包并安装软件,可以配置其使用特定的镜像作为默认下载渠道。具体方法如下: #### 修改命令行配置 通过一系列命令来添加清华大学镜像Conda 的通道列表中,并启用显示通道 URL 功能以便于追踪所使用的资位置。 ```bash 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/main/ conda config --set show_channel_urls yes ``` 这些指令将会把清华镜像加入到用户的 `.condarc` 文件里[^1]。 #### 编辑 .condarc 文件 另一种方式是直接编辑位于用户主目录下的 `.condarc` 文件,此文件遵循 YAML 格式的编写标准,允许自定义更多关于 Conda 行为和设置的内容。对于希望长期固定某些参数或偏好设定的情况下尤为适用。可以通过文本编辑器打开 `~/.condarc` 并手动输入所需的频道地址和其他配置项[^2]。 例如,在 `.condarc` 中添加以下内容: ```yaml channels: - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/ - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ show_channel_urls: true ``` 完成上述任一操作之后,Conda 将优先考虑已配置的国内镜像站点进行依赖解析与下载工作,从而提高效率减少等待时间。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值