编程语言
首页 > 编程语言> > python – 与cx_freeze的exe错误

python – 与cx_freeze的exe错误

作者:互联网

嘿,编译python脚本到exe是相对较新的.我使用cx_freeze编译我的脚本,一旦它构建我运行exe,它给了我这个错误.谷歌周围很多但不太确定.错误是:

Cannot import traceback module.
Exception: No module named re
Original Exception: No module named re

不太确定如何解决这个问题.我读到可能在名为re的模块之间存在冲突?在python?和一个名为re的模块在cx_freeze模块中?

我的设置文件如下:

from cx_Freeze import setup, Executable

includes = []
includefiles = ['remindersText.pkl']
eggsacutibull = Executable(
    script = "podlancer.py",
    initScript = None,
    base = 'Win32GUI',
    targetName = "podlancer.exe",
    compress = True,
    copyDependentFiles = True,
    appendScriptToExe = False,
    appendScriptToLibrary = False,
    icon = None
    )

setup(
        name = "Podlancer",
        version = "0.1",
        author = 'jono',
        description = "Podlancer UI script",
        options = {"build_exe": {"includes":includes, "include_files": includefiles}},
        executables = [eggsacutibull]
        )

解决方法:

试着改变

includes = []

includes = ["re"]

这对我有用

标签:python,pyqt4,cx-freeze
来源: https://codeday.me/bug/20191001/1838004.html