title: Creating a Python .exe file: py2exe invalid image error
body: <p>I want to create a <code>.exe</code> file. I'm using Python 2.7.3 with wxPython for the GUI. I've installed <code>py2exe</code> for Python 2.7 and tried to create a <code>.exe</code> file following the tutorial at <a href="http://www.py2exe.org/index.cgi/Tutorial" rel="nofollow">http://www.py2exe.org/index.cgi/Tutorial</a></p>
  
  <p>When I try to run my created <code>.exe</code> file, I get following error:</p>
  
  <pre><code>File "wx\_gdi.pyc",line823, in BitmapFromImage wx._core.PyAssertionError: 
  C++ assertion "image.OK()" failed at ..\..\src\msw\bitmap.cpp(802) in 
  wxBitmap::CreateFromImage(): invalid image
  </code></pre>
  
  <p>So I looked into my code and the following line is causing the problem: </p>
  
  <pre><code>self.bmpSun = wx.StaticBitmap(self, wx.ID_ANY, wx.BitmapFromImage(wx.Image('images/sun.gif', wx.BITMAP_TYPE_ANY)), pos = (0,0))
  </code></pre>
  
  <p>When I browse to the source folder and run the <code>main.py</code> file myself, my app runs fine. I haven't found any help online so far. Can anybody solve this problem/suggest reliable alternatives for <code>py2exe</code>? Thank you.</p>