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

username: acmilannesta
cooked: <p>Python 3.6.8<br>
Ubuntu 18.04 on virtualbox 6.1.14<br>
But kept giving me the error.</p>
<pre><code class="lang-auto">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
</code></pre>

username: ptrblck
cooked: <p>I’ve never encountered this error before. Could you update <code>zlib</code> or create a new virtual environment and reinstall PyTorch?</p>

username: RachelGomez161999
cooked: <p>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.</p>
<p>Here are a few possible solutions:</p>
<p>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:</p>
<p>arduino<br>
Copy code<br>
sudo apt-get install zlib1g-dev<br>
If zlib is already installed, try upgrading it to the latest version.</p>
<p>Check if the file you are trying to decompress is corrupted or incomplete. If it is, try downloading it again.</p>
<p>Try using a different installation method or package manager. For example, if you are using pip to install a package, try using conda instead.</p>
<p>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.</p>
<p>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.</p>
<p>Regards,<br>
Rachel Gomez</p>