0

Using PyInstaller (tested with 2.0 and dev version), I package the below code as an .exe:

import pandas as pd

df = pd.DataFrame([1, 2, 3])
print df.iloc[0]

When I run the executable, I end up getting the following error message:

Traceback (most recent call last):
  File "<string>", line 15, in <module>
  File "C:\Users\username\pyinstaller-2.0\Hello\build\pyi.win32\Hello\out00-PYZ.pyz\pandas.core.frame", line 1879, in __getattr__
AttributeError: 'DataFrame' object has no attribute 'iloc'

If I replace iloc with the older ix, everything works as it should so I'm suspecting that PyInstaller can't find/use the latest version of pandas. How can I get PyInstaller to work with iloc as well?

I'm using Python 2.7.4 and pandas 0.11.0 via WinPython on Windows 7.

joelostblom
  • 43,590
  • 17
  • 150
  • 159
  • iloc should be in 0.11 btw: http://pandas.pydata.org/pandas-docs/stable/whatsnew.html#selection-choices – Andy Hayden Aug 27 '13 at 17:03
  • Yeah, my code works fine when running it in the interpreter. It's only when packaging with PyInstaller that the problem arises. – joelostblom Aug 27 '13 at 17:06
  • 1
    perhaps you could do a test program and print pd.version.version ? – Andy Hayden Aug 27 '13 at 17:17
  • smart... that returns 0.9.1. and it also reminded me that i installed Enthought and Python(x,y) a long time back. I will remove them and see if it helps. – joelostblom Aug 27 '13 at 17:45
  • After rinsing all old python installations, I have gotten past this problem. Thank you! (new PyInstaller/pandas problem here http://stackoverflow.com/questions/18512167/pyinstaller-onefile-throws-qt-error-with-pandas-matplotlib-and-sklearn in case you have gotten any tips for that one as well) – joelostblom Aug 29 '13 at 13:25

0 Answers0