[conda报错]simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

当安装新环境和安装新包时,报错。
报错信息:

Collecting package metadata (current_repodata.json): \ ERROR conda.auxlib.logz:stringify(163): Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
  File "/home/anaconda3/lib/python3.8/site-packages/conda/auxlib/logz.py", line 157, in stringify
    requests_models_Response_builder(builder, obj)
  File "/home/anaconda3/lib/python3.8/site-packages/conda/auxlib/logz.py", line 133, in requests_models_Response_builder
    resp = response_object.json()
  File "/home/anaconda3/lib/python3.8/site-packages/requests/models.py", line 900, in json
    return complexjson.loads(self.text, **kwargs)
  File "/home/anaconda3/lib/python3.8/site-packages/simplejson/__init__.py", line 514, in loads
    return _default_decoder.decode(s)
  File "/home/anaconda3/lib/python3.8/site-packages/simplejson/decoder.py", line 386, in decode
    obj, end = self.raw_decode(s)
  File "/home/anaconda3/lib/python3.8/site-packages/simplejson/decoder.py", line 416, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)                                                                                                                                                            / ERROR conda.auxlib.logz:stringify(163): Expecting value: line 1 column 1 (char 0)

最终解决办法:
发现并不需要删除或者修改.condarc文件。看起来这个问题是channels的索引json文件出错导致的,我用conda clean -i命令移除了index cache,然后正常了。
(这里如果还不正常,可以在clean一下看看是否真的成功移除index)
答案来源:https://github.com/conda/conda/issues/9590

你可能感兴趣的:(conda)