Hi,
I use this small bat (rename buildDOTbat to build.bat) file to handle
the copying of the necessary GTK files and do the py2exe build. It
assumes GTK runtime is installed in "C:\GTK".

BTW, why do you explicitly exclude the "gtk" and "gtk.glade" modules?
I've updated the "setup.py" to look more like the one I use.

Regards,
Fredrik

2008/5/4 Chris Cole <[EMAIL PROTECTED]>:
> Hey all,
> I'm trying to use py2exe under windows to get my pygtk application into
> a single executable. Here's my steps so far:
>
> 1. I've installed the latest and greatest gtk runtime, python 2.5,
> pycairo, pygobject, pygtk, py2exe via their respective windows installers
>
> 2. i've added a simple setup.py script which seems to work fine for my
> app (attached)
>
> 3. i run:
>  python setup.py py2exe
>  which gives me a dist directory with my executable
>
> 4. i try to run the executable and it fails on importing the gtk module.
> Everywhere I've read so far says you need to copy the proper gtk runtime
> directories (lib, bin, share, etc) into the dist directory. I've tried:
>
> - putting all the dll's into the dist directory
>
> - putting the lib, bin, share, etc. directories into dist/gtk and even
> set the following in my script:
>
>  os.environ['PATH'] = ';gtk/lib;gtk/bin'
>
>
> - putting lib, bin, share, etc. into dist/
>
>
> but none of these work. It always fails on import gtk -- i've spent the
> last couple hours racking my brain (and google) and I can't figure it
> out. Any suggestions?
>
> Thanks,
>  Chris
>
> _______________________________________________
> pygtk mailing list   [email protected]
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
>
>
# setup.py
from distutils.core import setup
import py2exe, glob

opts = {
    'py2exe': {
    'includes': 'cairo,pango,pangocairo,atk,gobject,gtk.keysyms',
    "excludes": 'gtk, gtk.glade'
        }
    }

setup(
    name = 'FooApp',
    description = 'A Foo App',
    version = '0.1',
    windows = [{'script': 'foo.py'}],
    options=opts,
    data_files=[('.',glob.glob('screens/*')),
		('.',glob.glob('lib/*'))],
)

Attachment: buildDOTbat
Description: Binary data

_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to