Add and remove some anaconda channels may be the first thing you have to do after you have installed anaconda, because the default channel may be very slow in some locations when you plan to install python libraries by anaconda. In this tutorial, we will introduce how to add and remove anaconda channels for anaconda beginners.
Add and remove anaconda channels with configure file
The most easy way to add and remove anaconda channels is to edit anaconda configure file.
Anaconda configure file is called ‘.condarc‘, you can find this file in your user home path.
If you can not find it, we advice you to use Eeverything application to search.
Open .condarc file
If you want to add a channel, you can add a url in channels:
channels: - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ - defaults show_channel_urls: true ssl_verify: true
If you want to remove a channel, you can delete a channel url.
Save .condarc file.
Add and remove anaconda channels by conda command
We also can use conda config –add channels to add a channel.
Here is an example.
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ conda config --set show_channel_urls yes
If you want to remove a channel, we can use conda config –remove channels command.
Here is an example.
conda config --remove channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
Show all anaconda channels
To view all anaconda channels you have added, you can use command: conda config –show channels
Here is an example for showing all anaconda channels.
conda config --show channels
All channels are: