在Windows 10中conda更新失败

时间:2016-11-19 06:49:47

标签: python windows python-3.x anaconda conda

在此命令后以Anaconda作为管理员提示(窗口10 - 64位): conda update --all 我看到如下错误: 我想更新和安装软件包,但在输入每个命令后会出现这些错误。

conda update --all
Fetching package metadata ..........An unexpected error has occurred.
Please consider posting the following information to the
conda GitHub issue tracker at:

    https://github.com/conda/conda/issues



Current conda install:

               platform : win-64
          conda version : 4.2.9
       conda is private : False
      conda-env version : 4.2.9
    conda-build version : 2.0.2
         python version : 3.5.2.final.0
       requests version : 2.11.1
       root environment : D:\Anaconda3  (writable)
    default environment : D:\Anaconda3
       envs directories : D:\Anaconda3\envs
          package cache : D:\Anaconda3\pkgs
           channel URLs : http://www.lfd.uci.edu/~gohlke/pythonlibs/win-64/
                          http://www.lfd.uci.edu/~gohlke/pythonlibs/noarch/
                          http://github.com/scipy/scipy.git/win-64/
                          http://github.com/scipy/scipy.git/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/
                          https://repo.continuum.io/pkgs/msys2/win-64/
                          https://repo.continuum.io/pkgs/msys2/noarch/
            config file : C:\Users\Behnaz Eslami\.condarc
           offline mode : False



`$ D:\Anaconda3\Scripts\conda-script.py update --all`




    Traceback (most recent call last):
      File "D:\Anaconda3\lib\site-packages\conda\fetch.py", line 131, in fetch_repodata
        cache = json.loads(json_str)
      File "D:\Anaconda3\lib\json\__init__.py", line 319, in loads
        return _default_decoder.decode(s)
      File "D:\Anaconda3\lib\json\decoder.py", line 339, in decode
        obj, end = self.raw_decode(s, idx=_w(s, 0).end())
      File "D:\Anaconda3\lib\json\decoder.py", line 357, in raw_decode
        raise JSONDecodeError("Expecting value", s, err.value) from None
    json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "D:\Anaconda3\lib\site-packages\conda\exceptions.py", line 473, in conda_exception_handler
        return_value = func(*args, **kwargs)
      File "D:\Anaconda3\lib\site-packages\conda\cli\main.py", line 144, in _main
        exit_code = args.func(args, p)
      File "D:\Anaconda3\lib\site-packages\conda\cli\main_update.py", line 65, in execute
        install(args, parser, 'update')
      File "D:\Anaconda3\lib\site-packages\conda\cli\install.py", line 238, in install
        prefix=prefix)
      File "D:\Anaconda3\lib\site-packages\conda\api.py", line 24, in get_index
        index = fetch_index(channel_urls, use_cache=use_cache, unknown=unknown)
      File "D:\Anaconda3\lib\site-packages\conda\fetch.py", line 293, in fetch_index
        for url in urls]
      File "D:\Anaconda3\lib\site-packages\conda\fetch.py", line 293, in <listcomp>
        for url in urls]
      File "D:\Anaconda3\lib\site-packages\conda\fetch.py", line 70, in func
        res = f(*args, **kwargs)
      File "D:\Anaconda3\lib\site-packages\conda\fetch.py", line 137, in fetch_repodata
        .format(url, filename, e))
    conda.exceptions.CondaRuntimeError: Runtime error: Invalid index file: http://www.lfd.uci.edu/~gohlke/pythonlibs/win-64/repodata.json: Expecting value: line 1 column 1 (char 0)

我该如何解决这个问题?

2 个答案:

答案 0 :(得分:4)

尝试在命令提示符(admin)

上运行conda update conda

或转到 anaconda3 上的 anaconda安装文件夹right-click,转到{{1>},在“群组或用户名“点击Security,然后选中”允许“下的所有内容。

See this Image

答案 1 :(得分:0)

不要在普通终端窗口中运行或以管理员身份运行,而是打开 anaconda 终端。

  1. 在 Windows 10 搜索栏中,输入 cmd(不要按 Enter)
  2. 在结果中,您应该看到一个标题为“Anaconda prompt (anaconda 3)”
  3. 在这个 anaconda 终端中输入你的命令,例如conda update conda