Getting “ImportError: DLL load failed: The specified module could not be found” when using cx_Freeze even with tcl86t.dll and tk86t.dll added in

前端 未结 1 1586
别跟我提以往
别跟我提以往 2020-11-29 14:08

I am trying to convert a .py file to .exe using cx_Freeze 5.1.1., but an ImportError: DLL load failed pops up every time I try to run the file. Based on the sug

相关标签:
1条回答
  • 2020-11-29 14:37

    In cx_Freeze version 5.1.1, the included modules are in a subdirectory lib of the build directory. The tcl86t.dll and tk86t.dll DLLs apparently need to be moved there as well.

    You can do this with the following modification of your setup.py script:

    build_exe_options = {"packages": ["winsound", "random", "time", "tkinter", "math"],
                         "include_files": [('tcl86t.dll', os.path.join('lib', 'tcl86t.dll')),
                                           ('tk86t.dll', os.path.join('lib', 'tk86t.dll'))]}
    
    0 讨论(0)
提交回复
热议问题