(净化anaconda)conda install 中途打断出现ERROR REPORT

conda install 中途打断出现ERROR REPORT

conda install由于Ctrl C等中途打断,下次安装时出现错误如下报告:

Traceback (most recent call last):
      File "/home/ylq/anaconda2/lib/python2.7/site-packages/conda/exceptions.py", line 1062, in __call__
        return func(*args, **kwargs)
      File "/home/ylq/anaconda2/lib/python2.7/site-packages/conda/cli/main.py", line 84, in _main
        exit_code = do_call(args, p)
      File "/home/ylq/anaconda2/lib/python2.7/site-packages/conda/cli/conda_argparse.py", line 82, in do_call
        exit_code = getattr(module, func_name)(args, parser)
      File "/home/ylq/anaconda2/lib/python2.7/site-packages/conda/cli/main_create.py", line 37, in execute
        install(args, parser, 'create')
      File "/home/ylq/anaconda2/lib/python2.7/site-packages/conda/cli/install.py", line 256, in install
        force_reinstall=context.force_reinstall or context.force,
      File "/home/ylq/anaconda2/lib/python2.7/site-packages/conda/core/solve.py", line 112, in solve_for_transaction
        force_remove, force_reinstall)
      File "/home/ylq/anaconda2/lib/python2.7/site-packages/conda/core/solve.py", line 150, in solve_for_diff
        force_remove)
      File "/home/ylq/anaconda2/lib/python2.7/site-packages/conda/core/solve.py", line 249, in solve_final_state
        ssc = self._collect_all_metadata(ssc)
      File "/home/ylq/anaconda2/lib/python2.7/site-packages/conda/common/io.py", line 88, in decorated
        return f(*args, **kwds)
      File "/home/ylq/anaconda2/lib/python2.7/site-packages/conda/core/solve.py", line 389, in _collect_all_metadata
        index, r = self._prepare(prepared_specs)
      File "/home/ylq/anaconda2/lib/python2.7/site-packages/conda/core/solve.py", line 974, in _prepare
        self.subdirs, prepared_specs, self._repodata_fn)
      File "/home/ylq/anaconda2/lib/python2.7/site-packages/conda/core/index.py", line 214, in get_reduced_index
        repodata_fn=repodata_fn)
      File "/home/ylq/anaconda2/lib/python2.7/site-packages/conda/core/subdir_data.py", line 91, in query_all
        result = tuple(concat(executor.map(subdir_query, channel_urls)))
      File "/home/ylq/anaconda2/lib/python2.7/site-packages/concurrent/futures/_base.py", line 641, in result_iterator
        yield fs.pop().result()
      File "/home/ylq/anaconda2/lib/python2.7/site-packages/concurrent/futures/_base.py", line 462, in result
        return self.__get_result()
      File "/home/ylq/anaconda2/lib/python2.7/site-packages/concurrent/futures/thread.py", line 63, in run
        result = self.fn(*self.args, **self.kwargs)
      File "/home/ylq/anaconda2/lib/python2.7/site-packages/conda/core/subdir_data.py", line 87, in <lambda>
        package_ref_or_match_spec))
      File "/home/ylq/anaconda2/lib/python2.7/site-packages/conda/core/subdir_data.py", line 96, in query
        self.load()
      File "/home/ylq/anaconda2/lib/python2.7/site-packages/conda/core/subdir_data.py", line 160, in load
        _internal_state = self._load()
      File "/home/ylq/anaconda2/lib/python2.7/site-packages/conda/core/subdir_data.py", line 249, in _load
        mod_etag_headers.get('_mod'))
      File "/home/ylq/anaconda2/lib/python2.7/site-packages/conda/core/subdir_data.py", line 297, in _read_local_repdata
        _internal_state = self._process_raw_repodata_str(raw_repodata_str)
      File "/home/ylq/anaconda2/lib/python2.7/site-packages/conda/core/subdir_data.py", line 335, in _process_raw_repodata_str
        json_obj = json.loads(raw_repodata_str or '{}')
      File "/home/ylq/anaconda2/lib/python2.7/json/__init__.py", line 339, in loads
        return _default_decoder.decode(s)
      File "/home/ylq/anaconda2/lib/python2.7/json/decoder.py", line 364, in decode
        obj, end = self.raw_decode(s, idx=_w(s, 0).end())
      File "/home/ylq/anaconda2/lib/python2.7/json/decoder.py", line 380, in raw_decode
        obj, end = self.scan_once(s, idx)
    ValueError: Unterminated string starting at: line 514032 column 17 (char 14794576)

并且询问是否发送错误报告:

Would you like conda to send this report to the core maintainers?

[y/N]:

之后每次安装都会出现这个错误报告,是因为中途打断文件读写意外停止

可以使用conda clean命令净化anaconda:

Options:

usage: conda clean [-h] [-a] [-i] [-p] [-t] [-f]
                   [-c TEMPFILES [TEMPFILES ...]] [-d] [--json] [-q] [-v] [-y]

-a, --all

Remove index cache, lock files, unused cache packages, and tarballs.

-i, --index-cache

Remove index cache.

-p, --packages

Remove unused packages from writable package caches. WARNING: This does not check for packages installed using symlinks back to the package cache.

-t, --tarballs

Remove cached package tarballs.

-f, --force-pkgs-dirs

Remove all writable package caches. This option is not included with the --all flag. WARNING: This will break environments with packages installed using symlinks back to the package cache.

-c, --tempfiles

Remove temporary files that could not be deleted earlier due to being in-use. Argument is path(s) to prefix(es) where files should be found and removed.
必须选择一个option
一般使用:
conda clean --tarballs
删除tar包即可
若还是不行,则删除所有:
conda clean -a
若还是不行,重启Ubuntu,或者换回国外源

【最新解决方法】我在~/.condarc中删除了清华镜像,一切OK了。

你可能感兴趣的:(python,ubuntu,anaconda,python)