PyGTK + py2exe for Windows

Published on Nov. 2, 2008

I'm writing down these quick notes so I can remember the steps for getting py2exe to work with GTK.

  • Download the GTK+ runtime
  • Download py2exe
  • Copy over your project into the windows box
  • Create a setup.py file (see below)
  • Run "c:\Python25\python.exe setup.py py2exe"
  • Copy over the lib, etc, and share folder from C:\Program Files\GTK2-Runtime into the dist folder
  • Run app!

setup.py:

from distutils.core import setup
import py2exe

setup(
    name = 'ploteq',
    description = 'Bunnys Plotting Tool',
    version = '1.0',

    windows = [
                  {
                      'script': 'ploteq.py',
                  }
              ],

    options = {
                  'py2exe': {
                      'packages':'encodings',
                      'includes': 'cairo, pango, pangocairo, atk, gobject', 
                  }
              },

    data_files=[
                   'ploteq.glade',
               ]
)



Comments are currently closed for this entry.

About This Page

This entry is from my tutorial section and was written on Nov. 2, 2008. There have been 0 comments so far.

Via Twitter

@depping Tweeting while flying, that's almost ironic. (about 4 hours ago)