How can I remove a URL channel from Anaconda?
<p>Recently I needed to install PyPdf2 to one of my programs using Anaconda. Unfortunately, I failed, but the URLs that was added to Anaconda environment prohibit the updates of all the Conda libraries.
Every time I tried to update anaconda it gives the following </p>

<pre><code>conda update conda
Using Anaconda Cloud api site https://api.anaconda.org
Fetching package metadata ..........Error: Invalid index file: https://pypi.python.org/pypi/PyPDF2/1.26.0/win-64/repodata.json: No JSON object could be decoded
</code></pre>

<p>I typed the command <strong>conda info</strong> to see what causes the error, I found lots of URLs that points to PyPdf2!</p>

<p>Simply, I want to remove all these URLS from anaconda's channel URLs, How can I do it? No matter manually or automatic.</p>

<p>Note: I have uninstalled Anaconda, and reinstall, but no luck!</p>

<pre><code>C:\WINDOWS\system32&gt;conda info
Using Anaconda Cloud api site https://api.anaconda.org
Current conda install:

             platform : win-64
        conda version : 4.1.6
    conda-env version : 2.5.1
  conda-build version : 1.21.3
       python version : 2.7.12.final.0
     requests version : 2.10.0
     root environment : C:\Anaconda2  (writable)
  default environment : C:\Anaconda2
     envs directories : C:\Anaconda2\envs
        package cache : C:\Anaconda2\pkgs
         channel URLs : https://pypi.python.org/pypi/PyPDF2/1.26.0/win-64/
                        https://pypi.python.org/pypi/PyPDF2/1.26.0/noarch/
                        https://conda.anaconda.org/C:\Python27\Lib\site-packages\PyPDF2/win-64/
                        https://conda.anaconda.org/C:\Python27\Lib\site-packages\PyPDF2/noarch/
                        https://conda.anaconda.org/X:\Downloads\Compressed\PyPDF2-master\/win-64/
                        https://conda.anaconda.org/X:\Downloads\Compressed\PyPDF2-master\/noarch/
                        https://github.com/mstamy2/PyPDF2/zipball/master/win-64/
                        https://github.com/mstamy2/PyPDF2/zipball/master/noarch/
                        https://pypi.python.org/pypi/PyPDF2/win-64/
                        https://pypi.python.org/pypi/PyPDF2/noarch/
                        https://pythonhosted.org/PyPDF2/win-64/
                        https://pythonhosted.org/PyPDF2/noarch/
                        https://github.com/mstamy2/PyPDF2/win-64/
                        https://github.com/mstamy2/PyPDF2/noarch/
                        https://repo.continuum.io/pkgs/free/win-64/
                        https://repo.continuum.io/pkgs/free/noarch/
                        https://repo.continuum.io/pkgs/pro/win-64/
                        https://repo.continuum.io/pkgs/pro/noarch/
          config file : C:\Users\Dr. Mohammad Elnesr\.condarc
         offline mode : False
    is foreign system : False
</code></pre>

<p>Expanding upon Mohammed's <a href="http://stackoverflow.com/a/39566207/1193874">answer</a>.</p>

<p>All those URLs that you see in your <code>conda info</code> are your channel URLs. These are where conda will look for packages. As noted by @cel, these channels can be found in the <code>.condarc</code> file in your home directory. </p>

<p>You can interact with the channels, and other data, in your <code>.condarc</code> file with the <code>conda config</code> command.  For example, let's say your <code>.condarc</code> file lists the following channels:</p>

<pre><code>channels:
  - https://github.com/mstamy2/PyPDF2/  
  - defaults
</code></pre>

<p>Then if we do <code>conda config --get channels</code> we will see returned:</p>

<pre><code>--add channels 'defaults'   # lowest priority
--add channels 'https://github.com/mstamy2/PyPDF2/'   # highest priority
</code></pre>

<p>If we then want to remove the github channel we would do <code>conda config --remove channels 'https://github.com/mstamy2/PyPDF2/'</code>.  You can also add channels through the <code>--add</code> command so, for example, we could add back that channel with <code>conda config --add channels 'https://github.com/mstamy2/PyPDF2/'</code>.</p>

<p>In this case, since there were several channels to remove, it was probably faster to simply edit the <code>.condarc</code> directly but it's useful to know how to do it through <code>conda config</code>.</p>

python anaconda channel pypdf2