pip/conda配置镜像源

pip镜像源和conda镜像源配置

说明

windows11
anaconda



一. pip配置镜像源

1. 新建文件

在以下路径新建pip文件夹,在pip文件中新建pip.ini文件
在这里插入图片描述

2. 在pip.ini中添加源

2.1 清华镜像源

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = pypi.tuna.tsinghua.edu.cn

在这里插入图片描述

2.2 豆瓣镜像源

[global]
timeout = 60
index-url = https://pypi.doubanio.com/simple

(任选添加一个即可)

二. conda配置镜像源

2.1 新建文件

在以下路径新建.condarc文件,或者用命令在cmd生成文件
在这里插入图片描述
cmd文件生成命令(其实也是终端显示包从哪个channel下载的命令)

conda config --set show_channel_urls yes

2.2 添加源

清华源

#添加清华源
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/pkgs/r
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2

#显示源
conda config --set show_channel_urls yes

如图所示
在这里插入图片描述

2.3 查看

在这里插入图片描述

conda config --show channels

.condarc文件内容
在这里插入图片描述

参考链接(感谢)

总结

感谢大佬,祝安装一切顺利~

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值