title: Getting py2exe to work with zope.interface
body: <p>I have a Python app based on Twisted and PyGTK. Twisted itself depends on zope.interface, and I don't import it directly.</p>
  
  <p>Unfortunately, when I try to run my app, the following error ends up in the error log:</p>
  
  <pre><code>Traceback (most recent call last):
    File "tasks.py", line 4, in &lt;module&gt;
    File "ui\__init__.pyc", line 14, in &lt;module&gt;
    File "twisted\python\log.pyc", line 17, in &lt;module&gt;
  ImportError: No module named zope.interface
  Traceback (most recent call last):
    File "tasks.py", line 4, in &lt;module&gt;
    File "ui\__init__.pyc", line 14, in &lt;module&gt;
    File "twisted\python\log.pyc", line 17, in &lt;module&gt;
  ImportError: No module named zope.interface
  Traceback (most recent call last):
    File "tasks.py", line 4, in &lt;module&gt;
    File "ui\__init__.pyc", line 14, in &lt;module&gt;
    File "twisted\python\log.pyc", line 17, in &lt;module&gt;
  ImportError: No module named zope.interface
  </code></pre>
  
  <p>I've tried adding every combination of <code>zope.interface</code> and <code>zope</code> to <code>INCLUDES</code> and <code>PACKAGES</code>, but doing so only gives me this <strong>build time</strong> error:</p>
  
  <pre><code>running py2exe
  *** searching for required modules ***
  C:\Python26\lib\site-packages\py2exe\build_exe.py:16: DeprecationWarning: the sets module is deprecated
    import sets
  Traceback (most recent call last):
    File "setup.py", line 75, in &lt;module&gt;
      'gtk/*.ui'
    File "C:\Python26\lib\distutils\core.py", line 152, in setup
      dist.run_commands()
    File "C:\Python26\lib\distutils\dist.py", line 975, in run_commands
      self.run_command(cmd)
    File "C:\Python26\lib\distutils\dist.py", line 995, in run_command
      cmd_obj.run()
    File "C:\Python26\lib\site-packages\py2exe\build_exe.py", line 243, in run
      self._run()
    File "C:\Python26\lib\site-packages\py2exe\build_exe.py", line 296, in _run
      self.find_needed_modules(mf, required_files, required_modules)
    File "C:\Python26\lib\site-packages\py2exe\build_exe.py", line 1306, in find_needed_modules
      mf.import_hook(f)
    File "C:\Python26\lib\site-packages\py2exe\mf.py", line 719, in import_hook
      return Base.import_hook(self,name,caller,fromlist,level)
    File "C:\Python26\lib\site-packages\py2exe\mf.py", line 136, in import_hook
      q, tail = self.find_head_package(parent, name)
    File "C:\Python26\lib\site-packages\py2exe\mf.py", line 204, in find_head_package
      raise ImportError, "No module named " + qname
  ImportError: No module named zope
  </code></pre>
  
  <p>My <code>setup.py</code> is:</p>
  
  <pre><code>from distutils.core import setup
  import py2exe
  
  def find_data_files(source,target,patterns):
      # I've elided this, I doubt it's relevant to the problem
      # ...
  
  INCLUDES = [
      'cairo',
      'pango',
      'pangocairo',
      'atk',
      'gobject',
      'gio',
  ]
  
  PACKAGES = [
      'encodings',
  ]
  
  setup(
      name = 'MyApp',
      description = 'My Application',
      version = '1.0',
  
      windows = [
                    {
                        'script': os.path.join('ui','tasks.py'),
                        'icon_resources': [
                              (1, os.path.join(
                                  'ui','data','iconpack.ico'))
                          ],
                    }
                ],
  
      options = {
                    'py2exe': {
                        'packages': ','.join(PACKAGES),
                        'includes': ','.join(INCLUDES),
                    }
                },
  
      data_files = find_data_files(
                      'ui', 'ui', [
                          'data/*',
                          'gtk/*.ui'
                      ])
  
  )
  </code></pre>
  
  <p>How do I get py2exe to build this?</p>