在cx_冻结Python应用程序中导入熊猫非常慢

在cx_冻结Python应用程序中导入熊猫非常慢,python,pandas,cx-freeze,Python,Pandas,Cx Freeze,在我的cx_冻结python应用程序中,导入熊猫需要8.5秒 python 2.7 32位和python 3.3 64位 熊猫0.12.0 myprogram.py while 1: input = raw_input(">>") if input == "quit()": break try: t = time.clock() exec(input, globals(), locals()) print (

在我的cx_冻结python应用程序中,导入熊猫需要8.5秒

  • python 2.7 32位和python 3.3 64位
  • 熊猫0.12.0
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

我做错了什么吗?

没有明显的错误,但是如果你在setup.py中将pandas从
includes
移动到
包中,会更好吗?不,将pandas移动到“包”会产生相同的结果。我不知道是什么原因造成的。如果您想调试它,我会在导入中输入打印时间的调用,以确定哪个模块需要很长时间