Search code examples
pythonzlibtorch

zlib.error: Error -5 while decompressing data: incomplete or truncated stream


While installing torch by pip install torch it is throwin the below error

Exception:
/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/serialize.py", line 176, in _loads_v2
    cached = json.loads(zlib.decompress(data).decode("utf8"))
zlib.error: Error -5 while decompressing data: incomplete or truncated stream

Please help me out.


Solution

  • Removing pip's cache?

    This worked for me

    If using pip 6.0 or newer, try adding the --no-cache-dir option.