找到了解决方案!
我必须将tk86t.dll和tcl86t.dll文件从python目录的DLLs文件夹复制到带有尝试编译的main.py的build文件夹中。
这与
set TCL_LIBRARY=C:UsersVergilTheHuragokAppDataLocalProgramsPythonPython35tcltcl8.6 set TK_LIBRARY=C:UsersVergilTheHuragokAppDataLocalProgramsPythonPython35tcltk8.6
在我的compile.bat的顶部,以及
"include_files": ["tcl86t.dll", "tk86t.dll"]在setup.py的build_exe_options中,似乎已经解决了这个问题。
这是我当前的setup.py:
from cx_Freeze import setup, Executable import sysbuild_exe_options = {"packages": ["files", "tools"], "include_files": ["tcl86t.dll", "tk86t.dll"]}base = None if sys.platform == "win32": base = "Win32GUI"setup(name="Name", version="1.0", description="Description", options={"build_exe": build_exe_options}, executables=[Executable("main.py", base=base)], package_dir={'': ''}, )
这是我的compile.bat(已更新以显示所有步骤):
@echo offset TCL_LIBRARY=C:UsersVergilTheHuragokAppDataLocalProgramsPythonPython36-32tcltcl8.6set TK_LIBRARY=C:UsersVergilTheHuragokAppDataLocalProgramsPythonPython36-32tcltk8.6RD /S /Q "C:UsersVergilTheHuragokDesktopPythonProjectCompiledbin"mkdir "C:UsersVergilTheHuragokDesktopPythonProjectCompiledbin"xcopy /s "C:UsersVergilTheHuragokAppDataLocalProgramsPythonPython36-32DLLstcl86t.dll" "C:UsersVergilTheHuragokDesktopPythonProjectCompiledbintcl86t.dll"xcopy /s "C:UsersVergilTheHuragokAppDataLocalProgramsPythonPython36-32DLLstk86t.dll" "C:UsersVergilTheHuragokDesktopPythonProjectCompiledbintk86t.dll"cd "C:UsersVergilTheHuragokDesktopPythonProject"cxfreeze main.py --target-dir "C:UsersVergilTheHuragokDesktopPythonProjectCompiledbin" --target-name "launch.exe"pause
我在这里找到了这个解决方案。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)