conda和python配置阿里源

本文介绍如何将conda和pip配置为使用阿里云镜像源,包括通过命令行生成.condarc文件并编辑以指向阿里云提供的Anaconda通道,以及如何设置pip使用阿里云PyPI索引。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

conda配置阿里源:

首先win+r输入cmd进入管理员界面

其次输入conda config --set show_channel_urls yes生成 .condarc文件

最后在c盘用户目录下找到该文件并打开编辑输入以下代码并保存

channels:

        - defaults

show_channel_urls: true

default_channels:

        - http://mirrors.aliyun.com/anaconda/pkgs/main

        - http://mirrors.aliyun.com/anaconda/pkgs/r

        - http://mirrors.aliyun.com/anaconda/pkgs/msys2

custom_channels:

        conda-forge: http://mirrors.aliyun.com/anaconda/cloud

        msys2: http://mirrors.aliyun.com/anaconda/cloud

        bioconda: http://mirrors.aliyun.com/anaconda/cloud

        menpo: http://mirrors.aliyun.com/anaconda/cloud

        pytorch: http://mirrors.aliyun.com/anaconda/cloud

        simpleitk: http://mirrors.aliyun.com/anaconda/cloud

最后在管理员界面输入conda clean -i 清除索引缓存

python配置阿里源

win+r输入cmd进入管理员界面输入

pip config set global.index-url https://mirrors.aliyun.com/pypi/simple

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值