0

我正在使用 tkinter、cx_freeze 构建一个应用程序,并且我安装了 Anaconda。该应用程序需要很长时间才能打开(30 秒)。我认为这与 ananconda tcl 文件夹中的 tzdata 有关,因为当我在其上运行进程监视器时,我可以看到它打开了这些文件夹。如果我从我的 anaconda 文件夹中删除这些,这会破坏什么吗?有没有解决的办法?

from cx_Freeze import setup, Executable
import os.path
base = None    
PYTHON_INSTALL_DIR = os.path.dirname(os.path.dirname(os.__file__))
os.environ['TCL_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tcl8.6')
os.environ['TK_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tk8.6')


executables = [Executable("RunExcelMacro.py", base=base)]

packages = ["idna","tkinter","os","win32com.client"]
options = {
    'build_exe': {    
        'packages':packages,'include_files':[
            os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tk86t.dll'),
            os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tcl86t.dll'),
         ],
    },    
}


#os.environ['TCL_LIBRARY'] = r'C:\ProgramData\Anaconda3\tcl\tcl8.6'
#os.environ['TK_LIBRARY'] = r'C:\ProgramData\Anaconda3\tcl\tk8.6'
setup(
    name = "Background Excel Executor",
    options = options,
    version = "1.0",
    description = 'Runs an excel macro in the background',
    executables = executables
)
4

0 回答 0