Anaconda 更改下载源

安装了Anaconda、Pycharm,在终端中使用升级命令升级pip时,国内网络连接Anaconda的官方源,下载速度超级慢甚至连接不上,作为一个小白,刚接触这些深受其害,不堪回首。
因此,可以将下载源更改为一些常用的镜像站。

windows下 添加国内源

  • Anaconda
  1. 添加清华源
    打开Anaconda Prompt,在命令行中,直接使用以下命令:
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/conda-forge 
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
 
# 设置搜索时显示通道地址
conda config --set show_channel_urls yes
  1. 添加中科大源
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/menpo/
 
conda config --set show_channel_urls yes
  • Anaconda 换回默认源

在Anaconda Prompt中直接运行以下命令:

conda config --remove-key channels

file

  • path

C:\Users\[你的用户名]\.condarc , conda info 也可以查看。

  • file content

去掉 defaults, 就可以只保留使用清华源,将清华源移到第一项可以默认先使用清华源。

若源不生效,试着把.condarc文件中的 - defaults那行去掉。

channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  - defaults
show_channel_urls: true
ssl_verify: true
  • 5
    点赞
  • 31
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值