Python cx\u冻结时出现exe错误
嘿,我对将python脚本编译成exe比较陌生。我用cx_freeze来编译我的脚本,一旦编译完成,我就运行exe,它会给我这个错误。有谷歌在附近很多,但不是太确定。错误是: Cannot import traceback module. Exception: No module named re Original Exception: No module named rePython cx\u冻结时出现exe错误,python,pyqt4,cx-freeze,Python,Pyqt4,Cx Freeze,嘿,我对将python脚本编译成exe比较陌生。我用cx_freeze来编译我的脚本,一旦编译完成,我就运行exe,它会给我这个错误。有谷歌在附近很多,但不是太确定。错误是: Cannot import traceback module. Exception: No module named re Original Exception: No module named re 如果运行时工作目录不是可执行文件所在的目录,cx_freeze将呕吐 你是第一次进口吗?如果按不同的顺序执行,会发生什么情
如果运行时工作目录不是可执行文件所在的目录,cx_freeze将呕吐 你是第一次进口吗?如果按不同的顺序执行,会发生什么情况?尝试更改
includes = []
到
这对我很有效遇到同样的问题,把
re
放在包含中
对我不起作用。重建.py文件时,它生成了一个cx\u Freeze.freezer.ConfigError
import sys
from cx_Freeze import setup, Executable
build_exe_options = {'include_files': ['re']}
setup( name = "Foreground Window Montior",
version = "0.1",
description = "Query the foreground window.",
options = {'build_exe': build_exe_options},
executables = [Executable("actWin_Query.py")])
如果我将re
放在packages
而不是include\u文件中,则不会产生此编译错误
import sys
from cx_Freeze import setup, Executable
build_exe_options = {"packages": ["re"]}
setup( name = "Foreground Window Montior",
version = "0.1",
description = "Query the foreground window.",
options = {'build_exe': build_exe_options},
executables = [Executable("actWin_Query.py")])
图例=)谢谢兄弟!想知道实际发生了什么lol。我在编译它时考虑到它需要包含那个re模块,因为watever的原因…因此将它放在includes中(有意义,有点彻底,我没想到!)…有人知道这个re模块是干什么用的吗?这是cx_Freeze中的一个bug-应该在下一个版本中修复,希望在下个星期左右会有。
import sys
from cx_Freeze import setup, Executable
build_exe_options = {'include_files': ['re']}
setup( name = "Foreground Window Montior",
version = "0.1",
description = "Query the foreground window.",
options = {'build_exe': build_exe_options},
executables = [Executable("actWin_Query.py")])
import sys
from cx_Freeze import setup, Executable
build_exe_options = {"packages": ["re"]}
setup( name = "Foreground Window Montior",
version = "0.1",
description = "Query the foreground window.",
options = {'build_exe': build_exe_options},
executables = [Executable("actWin_Query.py")])