栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

当使用cx_Freeze和tkinter时,我得到:“ DLL加载失败:找不到指定的模块。” (Python 3.5.3)

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

当使用cx_Freeze和tkinter时,我得到:“ DLL加载失败:找不到指定的模块。” (Python 3.5.3)

找到了解决方案!

我必须将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

我在这里找到了这个解决方案。



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/638571.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号