How can I remove a URL channel from Anaconda?
Expanding upon Mohammed's answer.
All those URLs that you see in your conda info
are your channel URLs. These are where conda will look for packages. As noted by @cel, these channels can be found in the .condarc
file in your home directory.
You can interact with the channels, and other data, in your .condarc
file with the conda config
command. For example, let's say your .condarc
file lists the following channels:
channels:
- https://github.com/mstamy2/PyPDF2/
- defaults
Then if we do conda config --get channels
we will see returned:
--add channels 'defaults' # lowest priority
--add channels 'https://github.com/mstamy2/PyPDF2/' # highest priority
If we then want to remove the github channel we would do conda config --remove channels 'https://github.com/mstamy2/PyPDF2/'
. You can also add channels through the --add
command so, for example, we could add back that channel with conda config --add channels 'https://github.com/mstamy2/PyPDF2/'
.
In this case, since there were several channels to remove, it was probably faster to simply edit the .condarc
directly but it's useful to know how to do it through conda config
.
Fortunately, I found the answer (Thanks to @cel as well).
I navigated to C:\Users\{MyUserName}\
Then I found a file with no name but has a strange extension (.condarc
) I opened it with Notepad++, I found the files as below>
Then I deleted all lines except the last one, saved the file, then I ran the command conda update conda
, and it works without errors.
Hopefully my answer helps someone else out there using Mac OS terminal. I accidentally added "new_channel" to my channels list and could not figure out how to remove it. I also could not find the .condarc file (maybe someone will enlighten me please) but I was able to use the terminal to complete this.
There's two types of "channels" in Conda. One is the channels and one is the channel URLs. If you're trying to delete the the channel URL, you cannot delete it using:
conda config --remove channels
Originally I typed conda info
and saw the following:
channel URLs :
https://repo.anaconda.com/pkgs/pro/osx-64
https://repo.anaconda.com/pkgs/pro/noarch
https://conda.anaconda.org/new_channel/osx-64
https://conda.anaconda.org/new_channel/noarch
So I was thinking, ok, let me just type in the following.
conda config --remove channels https://conda.anaconda.org/new_channel/osx-64
THIS DOES NOT WORK.
What you have to do is type in the following:
conda config --show channels
You will see your channels:
channels:
defaults
new_channel
Now you know what your channel is called. It's called new_channel (may seem obvious, but sometimes not to us beginners).
So you type in:
conda config --remove channels new_channel
And boom, all the new_channel URLs are gone.
In OP's case, his channel was most likely called PyPdf2
So the correct code to type into Terminal is:
conda config --remove channels PyPdf2
AGAIN, DON'T TRY TO DELETE THE CHANNEL URL. MAKE SURE YOU DELETE THE CHANNEL ITSELF.