Installation error:zlib.error: Error -3 while decompressing data: invalid block type

Python 3.6.8
Ubuntu 18.04 on virtualbox 6.1.14
But kept giving me the error.

zw@zw-VirtualBox:~$ pip install torch-1.6.0+cu101-cp36-cp36m-linux_x86_64.whl
Processing ./torch-1.6.0+cu101-cp36-cp36m-linux_x86_64.whl
Requirement already satisfied: numpy in ./miniconda3/lib/python3.6/site-packages (from torch==1.6.0+cu101) (1.19.1)
Requirement already satisfied: future in ./miniconda3/lib/python3.6/site-packages (from torch==1.6.0+cu101) (0.18.2)
Installing collected packages: torch
ERROR: Exception:
Traceback (most recent call last):
  File "/home/zw/miniconda3/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 216, in _main
    status = self.run(options, args)
  File "/home/zw/miniconda3/lib/python3.6/site-packages/pip/_internal/cli/req_command.py", line 182, in wrapper
    return func(self, options, args)
  File "/home/zw/miniconda3/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 421, in run
    pycompile=options.compile,
  File "/home/zw/miniconda3/lib/python3.6/site-packages/pip/_internal/req/__init__.py", line 90, in install_given_reqs
    pycompile=pycompile,
  File "/home/zw/miniconda3/lib/python3.6/site-packages/pip/_internal/req/req_install.py", line 821, in install
    requested=self.user_supplied,
  File "/home/zw/miniconda3/lib/python3.6/site-packages/pip/_internal/operations/install/wheel.py", line 860, in install_wheel
    requested=requested,
  File "/home/zw/miniconda3/lib/python3.6/site-packages/pip/_internal/operations/install/wheel.py", line 689, in _install_wheel
    file.save()
  File "/home/zw/miniconda3/lib/python3.6/site-packages/pip/_internal/operations/install/wheel.py", line 456, in save
    shutil.copyfileobj(f, dest)
  File "/home/zw/miniconda3/lib/python3.6/shutil.py", line 79, in copyfileobj
    buf = fsrc.read(length)
  File "/home/zw/miniconda3/lib/python3.6/zipfile.py", line 872, in read
    data = self._read1(n)
  File "/home/zw/miniconda3/lib/python3.6/zipfile.py", line 948, in _read1
    data = self._decompressor.decompress(data, n)
zlib.error: Error -3 while decompressing data: invalid block type

I’ve never encountered this error before. Could you update zlib or create a new virtual environment and reinstall PyTorch?

This error message usually indicates that there is a problem with the zlib library, which is used for data compression and decompression. The error may occur when you are trying to install a package or library that uses zlib.

Here are a few possible solutions:

Check if zlib is installed on your system. If it is not installed, install it using the appropriate package manager for your system. For example, on Ubuntu, you can install zlib by running:

arduino
Copy code
sudo apt-get install zlib1g-dev
If zlib is already installed, try upgrading it to the latest version.

Check if the file you are trying to decompress is corrupted or incomplete. If it is, try downloading it again.

Try using a different installation method or package manager. For example, if you are using pip to install a package, try using conda instead.

If none of the above solutions work, try installing the package or library in a virtual environment. This can help isolate the installation from any system-level issues that may be causing the error.

If you are still having trouble after trying these solutions, please provide more information about the specific package or library you are trying to install and the steps you have taken so far.

Regards,
Rachel Gomez