镜像下载、域名解析、时间同步请点击 阿里巴巴开源镜像站

环境: conda/4.11.0 CPython/3.8.8 Windows/10

镜像源选用阿里云镜像站anaconda镜像:https://mirrors.aliyun.com/anaconda/

参考:https://conda.io/projects/conda/en/latest/user-guide/configuration/use-condarc.html#show-channel-urls-show-channel-urls

使用配置文件修改镜像源

  • 使用 conda info 命令查看 .condarc 配置文件位置(一般为 $env:userprofile/.condarc)

  • 在 PowerShell 中使用 notepad $env:userprofile/.condarc 命令,通过记事本打开 .condarc (若提示文件不存在,则点击创建)

    • CMD 中可以使用 notepad %userprofile%/.condarc 命令

将以下内容填入 .condarc 文件中

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

https://conda.io/projects/conda/en/latest/user-guide/configuration/use-condarc.html#channel-locations-channels

  • channels 的 defaults 会引用 default_channels 中的 URL
  • show_channel_urls 显示下载内容的 URL

使用命令行添加镜像源(失败)

失败原因:custom_channels 的值添加失败;custom_channels 下有仍有键值对,为嵌套关系,但 --add 只能添加一个 key;尝试空格,引号,冒号,括号,斜杠等没有找到方法可以嵌套添加

conda config --set show_channel_urls yes

conda config --add default_channels http://mirrors.aliyun.com/anaconda/pkgs/msys2

conda config --add default_channels http://mirrors.aliyun.com/anaconda/pkgs/r

conda config --add default_channels http://mirrors.aliyun.com/anaconda/pkgs/main

# conda config --add custom_channels conda-forge: http://mirrors.aliyun.com/anaconda/cloud
# conda config --add custom_channels msys2: http://mirrors.aliyun.com/anaconda/cloud
# conda config --add custom_channels bioconda: http://mirrors.aliyun.com/anaconda/cloud
# conda config --add custom_channels menpo: http://mirrors.aliyun.com/anaconda/cloud
# conda config --add custom_channels pytorch: http://mirrors.aliyun.com/anaconda/cloud
# conda config --add custom_channels simpleitk: http://mirrors.aliyun.com/anaconda/cloud

清理索引缓存

运行 conda clean -i 命令清除索引缓存,确保使用的是镜像站的索引。

原文链接:https://blog.csdn.net/m0_49270962/article/details/121882323

配置 conda 镜像环境的更多相关文章

  1. pip 和 Conda 镜像站配置

    如果你经常使用 Python,那么你对 pip 和 Conda 一定不陌生,它们作为包管理器,可以非常方便的帮助我们下载需要的 Python 包,但是受限于大多 Python 包的服务器在国外,国内下 ...

  2. conda+豆瓣源配置tensorflow+keras环境

    conda+豆瓣源配置tensorflow+keras环境 安装anaconda 打开Anaconda Prompt 创建虚拟环境 conda create -n myenv python=3.5 a ...

  3. 配置rt-thread开发环境(配置系统,生成系统镜像)

    配置rt-thread开发环境 ===========Python============= 1.Python的下载地址:http://www.python.org/ftp/python/ 链接中有各 ...

  4. ubuntu18+gtx1060 +cuda9+cudnn-v7+opencv3.1.0 配置深度学习环境

    将笔记本的ubuntu系统更新到18版本后重新配置深度学习环境,在此记载方便日后参考 具体配置为 Ubuntu18.04+gtx1060+opencv-3.1 第1步 安装依赖包 sudo apt-g ...

  5. 【系统配置】Ubuntu和Windons系统安装配置深度学习环境

    Ubuntu系统 1.备份 在服务器上整个装系统之前,需要做好一个工作,也就是相关重要数据的备份,这里主要是将固态中的数据备份到机械硬盘或移动硬盘里,可能在备份的过程中会遇到无法写入的问题,是因为文件 ...

  6. 配置安装theano环境(非GPU版)

    终于成功配置了theano环境,但由于本机没有gpu,所以配置的是非gpu版本的theano,下面将具体过程进行描述(安装成功后,有时对python的各种库进行更新时,可能会导致某个模块无法调用其他被 ...

  7. sql2008R2sp1局域网镜像环境实操(无见证服务器)

    环境介绍: 我的电脑:sql2008r2sp1_32 129.186.110.37 OS win2003 SP2 Enterprise     做主体服务器, 暂叫ServerA 服务器:    sq ...

  8. 配置RMAN备份环境

    关于配置RMAN备份环境你可以给每个目标数据库设置一些固定的配置,这些配置控制着RMAN多个方面的行为.例如,你可配置备份的保存策略.默认的备份目录.默认的备份设备类型等.你可以用show命令来查看配 ...

  9. Docker教程:使用docker配置python开发环境

    http://blog.csdn.net/pipisorry/article/details/50808034 Docker的安装和配置 [Docker教程:docker的安装] [Docker教程: ...

随机推荐

  1. TCP的报文详细解读

    这张图好像挺有名的,其实一开始我看见的时候是一脸懵逼的,但是通过翻书(大学时代最害怕的计算机网络),查阅他人博客等等办法,最后终于有了一个系统的了解,当然,这里知识点多而杂,大家可以多看几遍,结合上面 ...

  2. 《Effective Python》笔记——第4章 元类及属性

    一.用属性取代get和set方法 常规的get和set方法如下: class OldResistor(): def __init__(self, ohms): self.__ohms = ohms d ...

  3. shell——wait与多进程并发

    在脚本里用&后台打开多个子进程,用wait命令可以使这些子进程并行执行. 例1: fun1(){ while true do echo 1 sleep 1 done } fun2(){ whi ...

  4. Ubuntu 20.04.3 LTS + Intel Realsense 400系列

    Ubuntu 如何查看当前Ubuntu系统的版本,以及看自己的系统是否为LTS版本 lsb_release -a 如何查看Ubuntu系统的Linux系统版本,和GCC版本 cat /proc/ver ...

  5. ASP.NET Core 6框架揭秘实例演示[01]: 编程初体验

    作为<ASP.NET Core 3框架揭秘>的升级版,<ASP.NET Core 6框架揭秘>提供了很多新的章节,同时对现有的内容进行大量的修改.虽然本书旨在对ASP.NET ...

  6. spring5+Struts2+hibernate5

    一,加jar包 加入顺序,个人推荐,spring->struts2->hibernate spring的jar包:基本包共21个+用到的aspectj注解的包2个+日志包1个 ------ ...

  7. shell脚本命令

    http://man.linuxde.net/shell-script   从键盘或文件中获取标准输入:read命令 文件的描述符和重定向 数组.关联数组和别名的使用 函数的定义.执行.传参和递归函数 ...

  8. java中最简单的计算执行时长的方式

    日常在做一些性能测试的时候会通过执行时间来判断执行时长,java中最简单的方式如下: //开始时间 long startL= new Date().getTime(); //这里需要导入 java.u ...

  9. Solution -「多校联训」查拉图斯特拉如是说

    \(\mathcal{Description}\)   Link.   给定 \(n\) 和 \(m\) 次多项式 \(f(x)\),求 \[\sum_{i=0}^n\binom{n}{i}f(i)\ ...

  10. Solution -「洛谷 P4719」「模板」"动态 DP" & 动态树分治

    \(\mathcal{Description}\)   Link.   给定一棵 \(n\) 个结点的带权树,\(m\) 次单点点权修改,求出每次修改后的带权最大独立集.   \(n,m\le10^5 ...