[pygtk] py2exe...

John Pye john.pye at student.unsw.edu.au
Thu Apr 6 11:35:42 WST 2006


Hi all,

There seems to be a bug with using py2exe to package up a PyGTK
application. I get the following error when running the .exe that py2exe
generates:

G:\pygtkexample\dist>helloworld.exe
Traceback (most recent call last):
  File "helloworld.py", line 2, in ?
  File "pygtk.pyc", line 73, in require
AssertionError: required version '2.0' not found on system

It seems to me that the problem might come with the modification of
'sys.path' that pygtk.py try to do.

Attached is a minmal example ('helloworld.py' plus a glade file) as well
as the setup.py script.

Would very much appreciate any suggestions. We're currently trying to
build a windows installer for the ASCEND modelling package and we want
to be able to cut down on the large list of dependencies.

Cheers
JP

-- 
John Pye
School of Mechanical and Manufacturing Engineering
The University of New South Wales
Sydney  NSW 2052  Australia
t +61 2 9385 5127
f +61 2 9663 1222
mailto:john.pye_AT_student_DOT_unsw.edu.au
http://pye.dyndns.org/

-------------- next part --------------
from distutils.core import setup
import py2exe

setup(console=["helloworld.py"])
-------------- next part --------------
import pygtk
pygtk.require('2.0')
import gtk
import gtk.glade

class HelloWorld:
	def __init__(self):
		glade = gtk.glade.XML("helloworld.glade","mainwin")
		self.window = glade.get_widget("mainwin")
		glade.signal_autoconnect(self)

	def on_quitbutton_clicked(self,*args):
		gtk.main_quit()

	def run(self):
		self.window.show()
		gtk.main()

if __name__ == "__main__":
	app = HelloWorld();
	app.run()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: helloworld.glade
Type: text/xml
Size: 3895 bytes
Desc: not available
Url : http://www.daa.com.au/pipermail/pygtk/attachments/20060406/c8f5b73b/helloworld.bin


More information about the pygtk mailing list