title: Why does Pandas read_excel function return an error in Pyinstaller .exe but not under Python interpreter?
body: <p>I'm using the Pandas <code>read_excel</code> function to import data from a spreadsheet. This works fine when run under the Python interpreter, but when I build an exe with PyInstaller it returns an IndexError.</p>
  
  <p>Here's a simplified code <code>pandas_test.py</code> that demonstrates the problem:</p>
  
  <pre><code>import pandas as pd
  
  filepath = 'C:/Users/User/Documents/Development/Python/PHL/Test Data/Study 
  template mock-up.xlsx'
  df = pd.read_excel(filepath, sheet_name='Data Entry', index_col=9)
  print(df.head())
  </code></pre>
  
  <p>This runs just fine under Python 3.6 with pandas 0.23.4 and xlrd 1.1.0.</p>
  
  <p>When I build <code>pandas_test.py</code> with PyInstaller it successfully produces an <code>pandas_test.exe</code>, but I get this error:</p>
  
  <blockquote>
  <pre><code>Traceback (most recent call last):
    File "pandas_test.py", line 4, in &lt;module&gt;
    File "site-packages\pandas\io\excel.py", line 212, in read_excel
    File "site-packages\pandas\io\excel.py", line 513, in _parse_excel
    File "site-packages\pandas\io\parsers.py", line 1912, in TextParser
    File "site-packages\pandas\io\parsers.py", line 764, in __init__
    File "site-packages\pandas\io\parsers.py", line 995, in _make_engine
    File "site-packages\pandas\io\parsers.py", line 2021, in __init__
    File "site-packages\pandas\io\parsers.py", line 2772, in _get_index_name
    File "site-packages\pandas\io\parsers.py", line 3084, in _clean_index_names
  IndexError: list index out of range
  [17264] Failed to execute script pandas_test
  </code></pre>
  </blockquote>
  
  <p>I've read through the PyInstaller output, but there's nothing obviously related:</p>
  
  <pre><code>887 INFO: PyInstaller: 3.3.1
  887 INFO: Python: 3.6.2
  889 INFO: Platform: Windows-10-10.0.17134-SP0
  892 INFO: wrote C:\Users\User\Documents\Development\Python\PandaTest\pandas_test.spec
  </code></pre>
  
  <p>I could understand if some module was not found, but why an IndexError only in the deployed code?</p>