title: error: Error -3 while decompressing data: invalid distance too far back
body: <p>While I am trying to load the .mat file in Python, I am facing the following error:</p>
  <pre><code>    error                                     Traceback (most recent call last)
  &lt;ipython-input-4-c3171c29e3cc&gt; in &lt;module&gt;()
        1 if __name__ == '__main__':
        2     print('Inside Main')
  ----&gt; 3     mat = loadmat(&quot;/content/01_01_c0001_info.mat&quot;)
        4     print(&quot;File Read........&quot;)
  
  2 frames
  /usr/local/lib/python3.7/dist-packages/scipy/io/matlab/mio5.py in read_var_header(self)
      224             self._matrix_reader.set_stream(stream)
      225             check_stream_limit = self.verify_compressed_data_integrity
  --&gt; 226             mdtype, byte_count = self._matrix_reader.read_full_tag()
      227         else:
      228             check_stream_limit = False
  
  mio5_utils.pyx in scipy.io.matlab.mio5_utils.VarReader5.read_full_tag()
  
  mio5_utils.pyx in scipy.io.matlab.mio5_utils.VarReader5.cread_full_tag()
  
  streams.pyx in scipy.io.matlab.streams.ZlibInputStream.read_into()
  
  streams.pyx in scipy.io.matlab.streams.ZlibInputStream._fill_buffer()
  
  error: Error -3 while decompressing data: invalid distance too far back
  </code></pre>
  <p>As we can see the error is occurring in the loadmat function.</p>
  <p>The code example is given below:</p>
  <pre><code>import numpy as np
  from scipy.io import loadmat
  
  if __name__ == '__main__':
      print('Inside Main')
      mat = loadmat(&quot;/content/01_01_c0001_info.mat&quot;)
      print(&quot;File Read........&quot;)
  </code></pre>