当前位置:   article > 正文

【环境】pip install时出现json.decoder.JSONDecodeError报错

【环境】pip install时出现json.decoder.JSONDecodeError报错

报错如下:

Collecting omegaconf<2.4,>=2.2 (from hydra-core>=1.1->-r /home/eveing/DL/nlp/audiocraft/requirements.txt (line 23))
  Using cached omegaconf-2.3.0-py3-none-any.whl (79 kB)
ERROR: Exception:
Traceback (most recent call last):
  File "/home/eveing/anaconda3/envs/pytorch_2.0/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 169, in exc_logging_wrapper
    status = run_func(*args)
  File "/home/eveing/anaconda3/envs/pytorch_2.0/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 248, in wrapper
    return func(self, options, args)
  File "/home/eveing/anaconda3/envs/pytorch_2.0/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 377, in run
    requirement_set = resolver.resolve(
  File "/home/eveing/anaconda3/envs/pytorch_2.0/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 92, in resolve
    result = self._result = resolver.resolve(
  File "/home/eveing/anaconda3/envs/pytorch_2.0/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 546, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/home/eveing/anaconda3/envs/pytorch_2.0/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 427, in resolve
    failure_causes = self._attempt_to_pin_criterion(name)
  File "/home/eveing/anaconda3/envs/pytorch_2.0/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 239, in _attempt_to_pin_criterion
    criteria = self._get_updated_criteria(candidate)
  File "/home/eveing/anaconda3/envs/pytorch_2.0/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 230, in _get_updated_criteria
    self._add_to_criteria(criteria, requirement, parent=candidate)
  File "/home/eveing/anaconda3/envs/pytorch_2.0/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 173, in _add_to_criteria
    if not criterion.candidates:
  File "/home/eveing/anaconda3/envs/pytorch_2.0/lib/python3.8/site-packages/pip/_vendor/resolvelib/structs.py", line 156, in __bool__
    return bool(self._sequence)
  File "/home/eveing/anaconda3/envs/pytorch_2.0/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 155, in __bool__
    return any(self)
  File "/home/eveing/anaconda3/envs/pytorch_2.0/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 143, in <genexpr>
    return (c for c in iterator if id(c) not in self._incompatible_ids)
  File "/home/eveing/anaconda3/envs/pytorch_2.0/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 47, in _iter_built
    candidate = func()
  File "/home/eveing/anaconda3/envs/pytorch_2.0/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 206, in _make_candidate_from_link
    self._link_candidate_cache[link] = LinkCandidate(
  File "/home/eveing/anaconda3/envs/pytorch_2.0/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 262, in __init__
    cache_entry = factory.get_wheel_cache_entry(source_link, name)
  File "/home/eveing/anaconda3/envs/pytorch_2.0/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 540, in get_wheel_cache_entry
    return self._wheel_cache.get_cache_entry(
  File "/home/eveing/anaconda3/envs/pytorch_2.0/lib/python3.8/site-packages/pip/_internal/cache.py", line 245, in get_cache_entry
    return CacheEntry(retval, persistent=True)
  File "/home/eveing/anaconda3/envs/pytorch_2.0/lib/python3.8/site-packages/pip/_internal/cache.py", line 197, in __init__
    self.origin = DirectUrl.from_json(origin_direct_url_path.read_text())
  File "/home/eveing/anaconda3/envs/pytorch_2.0/lib/python3.8/site-packages/pip/_internal/models/direct_url.py", line 231, in from_json
    return cls.from_dict(json.loads(s))
  File "/home/eveing/anaconda3/envs/pytorch_2.0/lib/python3.8/json/__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "/home/eveing/anaconda3/envs/pytorch_2.0/lib/python3.8/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/home/eveing/anaconda3/envs/pytorch_2.0/lib/python3.8/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49

检查了/home/eveing/.cache/pip/wheels路径下的json文件为空

pip cache purge
  • 1

能缓解但是似乎不能完全解决

再次报错只能将cache对应路径下的全部文件(包括whl和json文件)删除,进而安装成功

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/539739
推荐阅读
相关标签
  

闽ICP备14008679号