pythonanacondaconda

remove default conda channels


I have just re-installed my anaconda. Below is my ~/.condarc

channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
  conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
show_channel_urls: true

However when I type

conda config --show channels I get the following

channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r

and conda config --show custom_channels still gives me the following:

custom_channels:
  pkgs/main: https://repo.anaconda.com
  pkgs/r: https://repo.anaconda.com
  conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud

How do I remove the repo.anaconda.com channels? As my conda is still trying to download packages from the default channels. I tried

conda config --remove channels https://repo.anaconda.com/pkgs/main

but got

CondaKeyError: 'channels': value 'https://repo.anaconda.com/pkgs/main' not present in config

Solution

  • managed to solve this in the end. For anyone having the same issue, run

    find / -name ".condarc" 2>/dev/null
    

    and see how many other .condarc files exist in your machine.

    I ended up deleting the other .condarc files.