title: Compiling exe with py2exe and including cefpython
body: <p>Im trying to compile my project for windows. Im on windows 2008 32 bit.</p>
  
  <p>It compiles with no issues but when I try and open the EXE it says it cannot import cefpython_27. The problem is from this file in cefpython in site-packages: (<strong>init</strong>.py)</p>
  
  <pre><code>import sys
  
  if 0x02070000 &lt;= sys.hexversion &lt; 0x03000000:
      from . import cefpython_py27 as cefpython
  elif 0x03000000 &lt;= sys.hexversion &lt; 0x04000000:
      from . import cefpython_py32 as cefpython
  else:
      raise Exception("Unsupported python version: " + sys.version)
  
  __version__ = "27.3"
  __author__ = "The CEF Python authors"
  </code></pre>
  
  <p>I suspect the problem is with this line:</p>
  
  <pre><code>from . import cefpython_py27 as cefpython
  </code></pre>
  
  <p>because that path is not relative to the EXE file.</p>
  
  <p>How should I be importing this?</p>
  
  <p>This is my setup.py file:</p>
  
  <pre><code>from distutils.core import setup
  import py2exe, os
  
  def get_cefpython_path():
      from cefpython3 import cefpython
      path = os.path.dirname(cefpython.__file__)
      return "%s%s" % (path, os.sep)
  
  def get_data_files():
      cefp = get_cefpython_path()
      data_files = [('', ['%s/icudt.dll' % cefp,
            '%s/d3dcompiler_43.dll' % cefp,
            '%s/devtools_resources.pak' % cefp,
            '%s/ffmpegsumo.dll' % cefp,
            '%s/libEGL.dll' % cefp,
            '%s/libGLESv2.dll' % cefp,
            '%s/Microsoft.VC90.CRT.manifest' % cefp,
            '%s/msvcm90.dll' % cefp,
            '%s/msvcp90.dll' % cefp,
            '%s/msvcr90.dll' % cefp]),
          ('locales', ['%s/locales/en-US.pak' % cefp]),
          ]
      print data_files
      return data_files
  setup(
      console=['videoinbox.py'],
      data_files = get_data_files()
  )
  </code></pre>
  
  <p>This is the error trying to open the EXE:</p>
  
  <pre><code>Traceback (most recent call last):
    File "videoinbox.py", line 41, in &lt;module&gt;
      from cefpython3 import cefpython
    File "cefpython3\__init__.pyc", line 4, in &lt;module&gt;
  ImportError: cannot import name cefpython_py27
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <p>So I have looked at the library.zip file and looked inside the cefpython3 directory. there is only a <strong>init</strong>.py file. this must be why its complaining. I then tried building that file and It complained so I added the files [cefpython_py27.pyd, icudt.dll] in the same direcotry and then it did run when calling it manually. </p>
  
  <p><em>Now Im not sure how to get this included from the build of py2exe? But even If I add this to the zip file it still sais its not found. Altough extracting the zip and doing python <strong>init</strong>.py it works!</em></p>