If you want to spend less time and energy on this, I would recommend engaging in a dialog with those trying to help you. If you had answered some of the questions posed back to you in previous replies, then we might have had the information we needed to help you more.


On the pygtk list you were pointed to this:




Have you built the py2exe/matplotlib/pygtk sample in that FAQ? Does it work for you? Please try it (remembering to copy the lib and etc directories into dist). It works for me. If it fails for you then we have the same example to work on in finding the problem.


One difference I notice between the sample’s setup.py and yours are that you are excluding all those DLLs, do you really want to do that? Assigning to sys.frozen is something I haven’t seen before - I don’t know how that would help although I don’t see the harm it would cause either. Once you have the sample working, I’d recommend copying the sample’s setup.py into the directory with HacGui.py (make a backup of your setup.py first). Then, assuming running HacGui.py directly works, just change the sample’s setup.py console script entry to HacGui.py, build, copy the GTK lib and etc directories into dist and see if that works.




p.s. - Calling py2exe a waste of time and energy is not respectful of the time and energy that Thomas Heller has put in, and I am now putting in, to create, maintain, and support py2exe for the community. py2exe has worked very well for me and many others for years now. I understand the frustration involved in becoming acquainted with a new technology, but keep in mind that it’s much easier for people to spend their own personal free time helping you if they feel respected.


From: py2exe-users-admin@lists.sourceforge.net [mailto:py2exe-users-admin@lists.sourceforge.net] On Behalf Of Rob M
Subject: [Py2exe-users] Them ol' py2exe blues...

Hi listers.

I seem to be getting closer to managing my build as I no longer get tracebacks related to matplotlib. I now however have the following totally frustrating problem when running the executable produced.

My script..

from distutils.core import setup
import py2exe
import glob
import sys
sys.frozen = True

opts = {
    "py2exe": {
        "includes": "pango,atk,gobject",
        "dll_excludes": [

    data_files = [('.', glob.glob(r'C:\PROGRA~1\Python24\share\MATPLO~1\*')),
                  ('.',          [r'C:\PROGRA~1\Python24\share\MATPLO~1\matplotlibrc'])],
    name        = 'GUI',
    description = 'Program',
    console     = ['HacGui.py']

The traceback:

ImportError: could not import atk
You need to install pyGTK or GTKv2  or set your PYTHONPATH correct
try: export PYTHONPATH= /usr/local/lib/python2.2/site-packages/

This is despite the fact that the path to gtk is on my sys path a PYTHONPATH var,a file with a .pth extension in my sitepackages dir and also after I copied the \lib and \etc dirs of gtk to my \dist directory,which about exhausts my fund of possible solutions. I've read every godamned wiki in existence and have tweaked the setup script in so many different ways I've lost count. I'm close to abandoning this py2exe thing completely right now as it's a massive waste of time and energy...

Any ideas?


Rob M.

------------------------------------------------------- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl _______________________________________________ Py2exe-users mailing list Py2exe-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/py2exe-users