Anaconda 3 replaces the domestic Tsinghua source tutorial (can't understand you hit me)

Anaconda 3 replaces the domestic Tsinghua source tutorial (can't understand you hit me)

In the previous article, we have introduced the installation of Anaconda 3. Although it has integrated many library packages of python, some packages are still not available. After installation, the official source of Anaconda 3 itself is abroad, and it is often not connected in China. , which leads to very slow loading of resources, so it is much faster to replace domestic sources

There are many sources in China, I chose Tsinghua source, because it has been officially recognized

The following will introduce how to replace the domestic Tsinghua source

1. First open the command window (win+r), enter cmd

2. Each system can modify the .condarc file in the user directory. Windows users cannot directly create a file named .condarc. You can execute the following command first to generate the file and then modify it. (You can copy the code and paste it directly in the command window with the right mouse button)

conda config --set show_channel_urls yes
  • 1


3. At this time, we come to the C drive -> User -> select the user just now, and you can see the file

4. Right-click the file and select the open method as Notepad.


If you don't see Notepad, you can find it in more applications Notepad can

5. Copy and paste all the following code into the file

//2020.5.29
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
  
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19

As shown in the figure:

6. After saving the file, close the file and execute the following command in the command window

conda clean - i   //Clear the index cache to ensure that the index provided by the mirror station is used.
  • 1

7. Test after finishing the previous command

conda create - n myenv numpy //Execute in the command window
  • 1

Enter y in the pop-up query to confirm

and continue to press y

8. Here you can see that successful indicates that the test is successful, and it has been successfully replaced with the domestic Tsinghua source.

If a small partner says that the library package cannot be installed after the replacement, you can refer to my other articles on installing library packages - Anaconda various methods for installing python third-party libraries , the connection is here
https://blog.csdn.net/weixin_44857413/article /details/106438719
-------------Separation line -----------

Tags: Anaconda 3 replaces the domestic Tsinghua source tutorial (can't understand you hit me)

Anaconda anaconda

Related: Anaconda 3 replaces the domestic Tsinghua source tutorial (can't understand you hit me)