使用PyInstaller(使用2.0和dev版本测试),我将下面的代码打包为.exe:
import pandas as pd
df = pd.DataFrame([1, 2, 3])
print df.iloc[0]
当我运行可执行文件时,我最终收到以下错误消息:
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'
如果我用较旧的iloc
替换ix
,一切都按原样运行,所以我怀疑PyInstaller无法找到/使用最新版本的pandas。如何让PyInstaller与iloc
一起使用?
我在Windows 7上通过WinPython使用Python 2.7.4和pandas 0.11.0。