anaconda的源配置的坑

  anaconda是一个python的科学计算的包集合,它提供了一个非常好用的包管理器 conda,类似于pip。

    为了速度(不仅为了速度,没有清华源你就被墙了,速度为0),我们使用清华源:

    在类unix下的~/.condarc是源的配置。

    可以使用:

  1. conda config --add channels 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/'
  2. conda config --set show_channel_urls yes

     添加清华源,也可以直接编辑添加

    channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/

-defaults
show_channel_urls: yes

    注意:有一个大坑,defaults的意义不是将以上的源设置为默认,它的意义是本身是个源,是官方的默认源。如果你在墙里的话,这个东西是被墙了的。也就是说,在检查源的这一步骤中将通不过。你无法执行任何联网的命令。

    因此,必须将其删掉。

原文地址:https://www.cnblogs.com/chenyansu/p/6762482.html