From: Waspinator on 24 Mar 2010 20:33 Hi, I'm trying to compile a python script on Ubuntu 9.10. It uses the gtk toolkit. I tried to run GUI2EXE for a cxfreeze gui, but even after installing wxPython in synaptic it still complains about not having it. I also tried to use cxfreeze by itself but the file it produces does not run. I tried to follow the information at http://cx-freeze.sourceforge.net/cx_Freeze.html I created a setup.py file that looks like this (from the page) from cx_Freeze import setup, Executable setup( name = "gtk_test", version = "0.1", description = "gtk_test", executables = [Executable("gtk_test.py")]) and ran: python setup.py build When I try to run the executable I get the following error: .../build/exe.linux-i686-2.6/library.zip/gtk/_gtk.py:12: RuntimeWarning: tp_compare didn't return -1 or -2 for exception ImportError: could not import gio ImportError: could not import gio Traceback (most recent call last): File "/usr/lib/pymodules/python2.6/cx_Freeze/initscripts/ Console.py", line 29, in <module> exec code in m.__dict__ File "gtk_test.py", line 274, in <module> File "gtk_test.py", line 228, in main AttributeError: 'module' object has no attribute 'Window' I was thinking of using the 'copy-dependent-files' option but I'm not sure how. Any ideas? Thanks
From: Sandy on 25 Mar 2010 08:15 I used cxFreeze without any problem on Ubuntu 9.10 32 bit version. I tried it on a wxPython gui script and it works fine though I did'n use any setup file. Just try cxFreeze executable (should be in /usr/bin/) instead of setup file. $/usr/bin/cxFreeze my_script.py --target-dir=/what_ever_dir/ what_ever_dir will have the executable file and other libraries needed to run the executable. - dksr On Mar 25, 12:33 am, Waspinator <patrickw...(a)gmail.com> wrote: > Hi, > > I'm trying to compile a python script on Ubuntu 9.10. It uses the gtk > toolkit. I tried to run GUI2EXE for a cxfreeze gui, but even after > installing wxPython in synaptic it still complains about not having > it. > > I also tried to use cxfreeze by itself but the file it produces does > not run. > > I tried to follow the information athttp://cx-freeze.sourceforge.net/cx_Freeze.html > > I created a setup.py file that looks like this (from the page) > > from cx_Freeze import setup, Executable > > setup( > name = "gtk_test", > version = "0.1", > description = "gtk_test", > executables = [Executable("gtk_test.py")]) > > and ran: > > python setup.py build > > When I try to run the executable I get the following error: > > ../build/exe.linux-i686-2.6/library.zip/gtk/_gtk.py:12: > RuntimeWarning: tp_compare didn't return -1 or -2 for exception > ImportError: could not import gio > ImportError: could not import gio > Traceback (most recent call last): > File "/usr/lib/pymodules/python2.6/cx_Freeze/initscripts/ > Console.py", line 29, in <module> > exec code in m.__dict__ > File "gtk_test.py", line 274, in <module> > File "gtk_test.py", line 228, in main > AttributeError: 'module' object has no attribute 'Window' > > I was thinking of using the 'copy-dependent-files' option but I'm not > sure how. > > Any ideas? > > Thanks
|
Pages: 1 Prev: the Python Foundation Next: Saving a page loaded using the webbrowser library? |