[2022] Nanny-level Anaconda installation and replacement domestic source tutorial

1. Anaconda installation

Since the Anaconda official website is overseas, in order to increase the download speed, we chose to download the Anaconda installation package from the mirror station of Beijing Foreign Studies University.

Index of /anaconda/archive/ | Beijing Foreign Studies University Open Source Software Mirror Station | BFSU Open Source Mirror https://mirrors.bfsu.edu.cn/anaconda/archive/ Drag to the bottom of the page and choose the one that matches your processor architecture , Download the latest version of the operating system.

As of writing, the latest version of Anaconda3 is 2021.11, here we choose windows, x86_64 version.

Download, install, continue to the next step, and the installation is over.

2. Anaconda source change

When we use the conda installation package, we often encounter inexplicable error reports and sudden download failures. This is because the download server is overseas and the network is unstable.

Here we replace anaconda with domestic sources.

TUNA provides a mirror image of the Anaconda warehouse and third-party sources (conda-forge, msys2, pytorch, etc.), and each system can modify the files in the user directory  .condarc . Windows users cannot directly create  .condarc a file named by executing 

conda config --set show_channel_urls yes

 Modify the file after generating it.

The generated files are in the root directory of the current user. 

Replace the content inside with the following (choose one of four):

Beijing Foreign Studies University open source software mirror site

channels:
  - defaults
show_channel_urls: true
channel_alias: https://mirrors.bfsu.edu.cn/anaconda
default_channels:
  - https://mirrors.bfsu.edu.cn/anaconda/pkgs/main
  - https://mirrors.bfsu.edu.cn/anaconda/pkgs/free
  - https://mirrors.bfsu.edu.cn/anaconda/pkgs/r
  - https://mirrors.bfsu.edu.cn/anaconda/pkgs/pro
  - https://mirrors.bfsu.edu.cn/anaconda/pkgs/msys2
custom_channels:
  conda-forge: https://mirrors.bfsu.edu.cn/anaconda/cloud
  msys2: https://mirrors.bfsu.edu.cn/anaconda/cloud
  bioconda: https://mirrors.bfsu.edu.cn/anaconda/cloud
  menpo: https://mirrors.bfsu.edu.cn/anaconda/cloud
  pytorch: https://mirrors.bfsu.edu.cn/anaconda/cloud
  simpleitk: https://mirrors.bfsu.edu.cn/anaconda/cloud

 or

Shanghai Jiaotong University Open Source Software Mirror Station

channels:
  - defaults
show_channel_urls: true
channel_alias: https://anaconda.mirrors.sjtug.sjtu.edu.cn/
default_channels:
  - https://anaconda.mirrors.sjtug.sjtu.edu.cn/pkgs/main
  - https://anaconda.mirrors.sjtug.sjtu.edu.cn/pkgs/free
  - https://anaconda.mirrors.sjtug.sjtu.edu.cn/pkgs/mro
  - https://anaconda.mirrors.sjtug.sjtu.edu.cn/pkgs/msys2
  - https://anaconda.mirrors.sjtug.sjtu.edu.cn/pkgs/pro
  - https://anaconda.mirrors.sjtug.sjtu.edu.cn/pkgs/r
custom_channels:
  conda-forge: https://anaconda.mirrors.sjtug.sjtu.edu.cn/conda-forge
  soumith: https://anaconda.mirrors.sjtug.sjtu.edu.cn/cloud/soumith
  bioconda: https://anaconda.mirrors.sjtug.sjtu.edu.cn/cloud/bioconda
  menpo: https://anaconda.mirrors.sjtug.sjtu.edu.cn/cloud/menpo
  viscid-hub: https://anaconda.mirrors.sjtug.sjtu.edu.cn/cloud/viscid-hub
  atztogo: https://anaconda.mirrors.sjtug.sjtu.edu.cn/cloud/atztogo

or

Alibaba Open Source Software Mirror Site

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

or

Tsinghua University Open Source Software Mirror Station

channels:
  - defaults
show_channel_urls: true
channel_alias: https://mirrors.tuna.tsinghua.edu.cn/anaconda
default_channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
  conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud

After the modification is saved, the Anaconda Python free warehouse can be added.

run 

conda clean -i 

Clear the index cache and ensure that the index provided by the mirror site is used.

At this point, the Anaconda configuration is complete.

A little suggestion: Give the shortcut of the anaconda terminal administrator privileges to avoid unexpected errors.

Guess you like

Origin blog.csdn.net/weixin_41673825/article/details/123901866