title: Python: 'NoneType' object has no attribute 'decompressobj'
body: <p>I'm using Python 2.7.11 on Ubuntu.</p>
  
  <p>I'm trying to open an Excel file (.xlsx) in Python using <code>xlrd</code> package. However I get the following error when I try to use the <code>open_workbook()</code> function from the package to open my Excel file:</p>
  
  <pre><code>Traceback (most recent call last):
  
      File "TileInserter.py", line 15, in &lt;module&gt;
          book = open_workbook(sheetPath, on_demand=True)
  
      File "/usr/local/lib/python2.7/site-packages/xlrd/__init__.py", line 422, in open_workbook
          ragged_rows=ragged_rows,
  
      File "/usr/local/lib/python2.7/site-packages/xlrd/xlsx.py", line 761, in open_workbook_2007_xml
          zflo = zf.open(component_names['xl/_rels/workbook.xml.rels'])
  
      File "/usr/local/lib/python2.7/zipfile.py", line 1010, in open
          close_fileobj=should_close)
  
      File "/usr/local/lib/python2.7/zipfile.py", line 526, in __init__
          self._decompressor = zlib.decompressobj(-15)
  
  AttributeError: 'NoneType' object has no attribute 'decompressobj'
  </code></pre>
  
  <p>I tried to google the cause of this error and found that this could happen if the <code>zlib</code> library is not installed. But when I checked using PHP's <code>phpinfo()</code> function, it shows that <code>zlib</code> is installed. And that too the latest version (version 1.2.8).</p>
  
  <p>So I'm kinda stuck now. Does anyone know how to solve this issue?</p>
  
  <p><strong>EDIT</strong>: My actual code in <code>TileInserter.py</code> goes like this (<code>TileInserter.py</code> and <code>TileList.xlsx</code> being in the same directory):</p>
  
  <pre><code>from xlrd import open_workbook
  
  sheetPath = "TileList.xlsx"
  #some more variables
  
  #Open Excel file
  book = open_workbook(sheetPath, on_demand=True)
  for name in book.sheet_names():
      if name.endswith('1'):
          sheet = book.sheet_by_name(name)
  </code></pre>