5

即使在创建新环境时,我的 conda-forge 也无法正常工作并显示以下错误:

(base) C:\Users\1836849\Documents\GitHub_Repository\ChemOS-master>conda create -n py36 python=3.6
Collecting package metadata (current_repodata.json): failed

UnavailableInvalidChannel: The channel is not accessible or is invalid.
  channel name: conda-forge
  channel url: https://conda.anaconda.org/conda-forge
  error code: 403

You will need to adjust your conda configuration to proceed.
Use `conda config --show channels` to view your configuration's current state,
and use `conda config --show-sources` to view config file locations.

conda info显示此信息:

    (base) C:\Users\1836849\Documents\GitHub_Repository\ChemOS-master>conda info

     active environment : base
    active env location : C:\ProgramData\Anaconda3
            shell level : 1
       user config file : C:\Users\1836849\.condarc
 populated config files : C:\Users\1836849\.condarc
          conda version : 4.9.2
    conda-build version : 3.20.5
         python version : 3.8.5.final.0
       virtual packages : __win=0=0
                          __archspec=1=x86_64
       base environment : C:\ProgramData\Anaconda3  (writable)
           channel URLs : https://conda.anaconda.org/conda-forge/win-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://conda.anaconda.org/anaconda-fusion/win-64
                          https://conda.anaconda.org/anaconda-fusion/noarch
                          https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
          package cache : C:\ProgramData\Anaconda3\pkgs
                          C:\Users\1836849\.conda\pkgs
                          C:\Users\1836849\AppData\Local\conda\conda\pkgs
       envs directories : C:\ProgramData\Anaconda3\envs
                          C:\Users\1836849\.conda\envs
                          C:\Users\1836849\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/4.9.2 requests/2.24.0 CPython/3.8.5 Windows/10 Windows/10.0.18362
          administrator : True
             netrc file : None
           offline mode : False

什么是可能的解决方案?

4

1 回答 1

0

根据此处的文档,有几个可能的原因会收到此错误:

  • 用户在他们的配置中错误配置了他们的频道(例如,存储令牌的安全位置被意外删除(最常见)

  • 防火墙或其他安全设备或系统阻止用户访问(第二常见)

  • 由于可能违反服务条款(第三常见),他们阻止了访问

解决方案

首先,运行以下命令撤消您对商业版的配置:

conda config --remove-key default_channels

接下来,安装或升级 conda-token 工具:

conda install --freeze-installed conda-token

最后,重新应用令牌和配置设置:

# Replace <TOKEN> with your token
conda token set <TOKEN>
于 2021-07-15T17:37:45.740 回答