在我的cx_freeze冻结python应用程序中导入pandas需要8.5秒。
myprogram.py
while 1:
input = raw_input(">>")
if input == "quit()": break
try:
t = time.clock()
exec(input, globals(), locals())
print ("%f" % (time.clock() - t))
except Exception as e:
print (str(e))
setup.py
from cx_Freeze import setup, Executable
build_exe_options = {
"includes": ['pandas'],
"packages": [],
'excludes' : ['PyQt4.uic.port_v3', 'Tkconstants', 'tcl', 'tk', 'doctest', '_gtkagg', '_tkagg', 'bsddb', 'curses', 'email', 'pywin.debugger', 'pywin.debugger.dbgcon', 'pywin.dialogs', 'Tkinter', 'tables', 'zmq', 'win32', 'Pythonwin', 'Cython', 'statmodels', 'cvxopt', '_sqlite3', '_ssl', '_testcapi', 'markupsafe', 'numexpr', '_elementtree', '_hashlib', '_testcapi', 'bz2', 'simplejson', 'pyexpat', 'lxml', 'matplotlib', 'guidata', 'PyQt4', 'PySide', 'scipy', '_multiprocessing', '_ctypes', 'PIL'],
"include_files": []}
setup(
name = "my_program",
version="2.0.0",
description="",
author = "",
options = { "build_exe": build_exe_options},
executables = [Executable("my_program.py", shortcutName="my_program", shortcutDir="DesktopFolder")])
在my_program.exe中
>>import pandas
8.579099
我做错了吗?