shiqi

shiqi

Study GIS, apply to world
twitter
github
bento
jike

Tuna for Conda

Methods for resetting after conda clean all are recorded
It is worth noting that it is recommended to directly connect to Tsinghua source

Changing the mirror source of conda to Tsinghua source can significantly improve the download and update speed for domestic users. Here are the steps to switch to 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 channel URLs to see which source is being used when searching and installing packages:

    conda config --set show_channel_urls yes
    
  4. If needed, add other third-party sources like 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 the new mirror source is being used:

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

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

    conda config --remove-key channels
    

Please note that after changing the source, it may be necessary to reinstall or update some packages to ensure they are from the new mirror source.

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