使用twisted和cx_freeze运行时错误

时间:2013-12-06 12:43:02

标签: python twisted cx-freeze

我目前正在尝试使用与cx_freeze的twisted来冻结一些python代码。

我在我的python文件Main.py中有这个:

print('Start')
import twisted.internet
input('End')

并在setup.py文件中:

import sys
from cx_Freeze import setup, Executable
includes = ["twisted.internet", "twisted.internet.protocol", "pkg_resources"]
excludes = []
packages = []
namespace_packages = ["zope"]
build_exe_options = {"packages": packages, "excludes": excludes, "includes": includes,      "namespace_packages": namespace_packages, "append_script_to_exe":True}
base = None
#if sys.platform == "win32":
#    base = "Win32GUI"
setup(  name = "xxx",
    version = "1.0",
    author = "xxx",
    author_email = "xxx",
    description = "xxx",
    options = {"build_exe": build_exe_options},
    executables = [Executable("Main.py", base=base, icon = None)])

当我运行编译的程序时,我不断收到运行时错误R6034。有人知道为什么吗?

1 个答案:

答案 0 :(得分:0)

最后,我使用了一种解决方法。我发现文件zope.interface._zope_interface_coptimizations是问题的根源(它无法加载)所以我将它排除在我的setup.py文件中:

excludes = ["zope.interface._zope_interface_coptimizations"]

它现在运作良好,但最初的问题没有解决,我担心我会在某个时候需要这个包。