Python py2exe,twisted,zope.interface

Python py2exe,twisted,zope.interface,python,twisted,py2exe,zope,Python,Twisted,Py2exe,Zope,我正在尝试创建twisted项目的windows服务。windows服务作为一个整体在python上工作,但当我将其转换为py2exe时 我试过这些 但似乎什么都不管用 from distutils.core import setup import py2exe import clinet_service setup( options = { 'py2exe': { "compressed": 1, 'optimize': 2,

我正在尝试创建twisted项目的windows服务。windows服务作为一个整体在python上工作,但当我将其转换为py2exe时

我试过这些

但似乎什么都不管用

from distutils.core import setup
import py2exe
import clinet_service

setup(
  options = {
    'py2exe': {
        "compressed": 1,
        'optimize': 2, 
        "packages": ["email","twisted","twisted.web.resource"],
        'bundle_files': 1,
        'includes' : ["win32com", "zope.interface"],
        "excludes": ["MySQLdb", "Tkconstants", "Tkinter","tcl","orm.adapters.pgsql","orm.adapters.mysql"],
        "dll_excludes": ["tcl84.dll", "tk84.dll","wxmsw26uh_vc.dll"]            
    }
},    
console=["clinet_service.py"],
zipfile = None    
)

这表明:

 The following modules appear to be missing
 ['CFNetwork', 'Carbon', 'Carbon.Files', 'CoreFoundation', 'Crypto', 'Crypto.Cip
 er', 'Crypto.Cipher.AES', 'Crypto.Cipher.DES3', 'Crypto.Cipher.XOR', 'Crypto.Pu
 licKey', 'Cython.Distutils', 'OpenSSL', 'OpenSSL.SSL', 'OpenSSL.crypto', 'PAM',
'SOAPpy', '_curses', '_scproxy', 'crypt', 'dummy.plugins', 'email.Charset', 'em
il.Encoders', 'email.Errors', 'email.Generator', 'email.Header', 'email.Iterato
s', 'email.MIMEAudio', 'email.MIMEBase', 'email.MIMEImage', 'email.MIMEMessage'
'email.MIMEMultipart', 'email.MIMEText', 'email.Message', 'email.Parser', 'ema
l.Utils', 'email.base64MIME', 'email.quopriMIME', 'eunuchs.tuntap', 'gadfly', '
i.pygtkcompat', 'gi.repository', 'gmpy', 'gnome', 'gobject', 'goodpackage', 'gt
', 'gtk.glade', 'html', 'idonotexist', 'importlib.invalidate_caches', 'kinterba
db', 'mypackage', 'mypackage.testplugin', 'package', 'plugindummy.plugins', 'po
tmap', 'psycopg', 'pyPgSQL', 'pyasn1', 'pyasn1.codec.ber', 'pyasn1.type', 'pydo
tor.driver', 'pygtk', 'pyui', 'queue', 'quixote', 'resource', 'serial', 'shadow
, 'sitecustomize', 'spwd', 'sqlite', 'subunit', 'syslog', 'twisted.plugins.fake
ndpoint', 'twisted.python._epoll', 'twisted.python._initgroups', 'twisted.pytho
.sendmsg', 'twisted_private_helper', 'twisted_python_versions_package', 'twiste
_rebuild_fakelib', 'twisted_renamed_helper', 'uberpackage', 'urllib.parse', 'us
rcustomize', 'utmp', 'win32com.gen_py', 'win32com.shell', 'wx', 'wxPython.wx']
我错过了什么?”

--------------编辑

我得到了解决方案,我重新编写了这个脚本,做了一些修改,这是我的脚本。只有在站点包/zope中的init.py之后,Py2exe才成功。这是我的剧本

  from distutils.core import setup
  import py2exe

  class BinaryDetails:

  def __init__(self, **kw):

    # for the versioninfo resources

    self.__dict__.update(kw)
    self.version = "1.1"
    self.company_name = "myworld"
    self.copyright = "myrights"
    self.name = "someprgms"    

    binary_service = BinaryDetails(
                            description = 'description',
                            includes = [],
                            modules = ['myservice'],
                            cmdline_style='pywin32'
                            )

    setup(
         options = {
                'py2exe': {
                            "compressed": 1,
                            'optimize': 2, 
                            "packages": ["email","twisted"],
                            'bundle_files': 1,
                            'includes' : ['lxml._elementpath','zope.interface'],
                            "excludes": ["MySQLdb", "Tkconstants", "Tkinter","tcl","orm.adapters.pgsql","orm.adapters.mysql"],
                            "dll_excludes": ["tcl84.dll", "tk84.dll","wxmsw26uh_vc.dll"]            
                            }
                },
    console = ["myservice.py"],
    zipfile = None,
    service=[binary_service]

   )  

最好是回答问题并接受答案你试过了吗?如果是,为什么选择py2exe?(我会做出类似的决定。)