shiqi

shiqi

Study GIS, apply to world
twitter
github
bento
jike

Tuna for Conda

Method for resetting after conda clean all record
It is worth noting that it is recommended to directly connect to Tsinghua source

Changing the mirror source of conda to Tsinghua can significantly improve the download and update speed for domestic users. Here are the steps to switch to the Tsinghua source:

  1. Open Anaconda Prompt (or command line terminal).

  2. Add Tsinghua source channels using the following commands:

    conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
    conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
    conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
    
  3. Display the channel URLs so that you can see which source is being used when searching and installing packages:

    conda config --set show_channel_urls yes
    
  4. If needed, you can add other third-party sources such as conda-forge, msys2, bioconda, etc.:

    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 --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
    
  5. Clear the old index cache to ensure that the newly added mirror source is being used:

    conda clean -i
    
  6. After confirming the source change, you can check conda's configuration using the following command:

    conda info
    
  7. If you need to revert the configuration back to the default source, you can use the following command:

    conda config --remove-key channels
    

Please note that after changing the source, you may need to reinstall or update some packages to ensure they are coming from the new mirror source.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.