From: Daniel R. <dv...@gm...> - 2006-04-28 02:42:40
|
All, I'm a newbie in the PythonCard world, and I'm encountering an error when I use py2exe to create a stand-alone executable. My error log looks like this: Traceback (most recent call last): File "GUI.py", line 555, in ? File "PythonCard\model.pyc", line 337, in __init__ File "PythonCard\resource.pyc", line 48, in getResource File "PythonCard\resource.pyc", line 86, in __init__ File "PythonCard\resource.pyc", line 91, in __init__ File "PythonCard\resource.pyc", line 91, in __init__ File "PythonCard\resource.pyc", line 96, in __init__ File "PythonCard\resource.pyc", line 139, in enforceSpec File "PythonCard\resource.pyc", line 30, in loadComponentModule ImportError: cannot import module 'staticline Anybody encounter this before/know the way to fix it? Thanks, Dan |
From: Phil E. <ph...@li...> - 2006-04-28 12:00:21
|
On Friday 28 Apr 2006 03:42, Daniel Ryan wrote: > All, > > I'm a newbie in the PythonCard world, and I'm encountering an error when I > use py2exe to create a stand-alone executable. My error log looks like > this: > Traceback (most recent call last): > File "GUI.py", line 555, in ? > File "PythonCard\model.pyc", line 337, in __init__ > File "PythonCard\resource.pyc", line 48, in getResource > File "PythonCard\resource.pyc", line 86, in __init__ > File "PythonCard\resource.pyc", line 91, in __init__ > File "PythonCard\resource.pyc", line 91, in __init__ > File "PythonCard\resource.pyc", line 96, in __init__ > File "PythonCard\resource.pyc", line 139, in enforceSpec > File "PythonCard\resource.pyc", line 30, in loadComponentModule > ImportError: cannot import module 'staticline > > Anybody encounter this before/know the way to fix it? > Yup - what you need to do is add a line into your code which explicitly imports the required PythonCard components. For your GUI.py program, you'll need to add something like: from PythonCard.components import staticline, statictext, textarea, \ button Since these are the components you've got in your GUI.rsrc.py file. Just FYI, I'm using your code to help debug the latest version of standaloneBuilder, with some help from Alex Tweedly. -- Regards Phil Edwards Brighton, UK |
From: Daniel R. <dv...@gm...> - 2006-04-28 13:00:43
|
Phil, Great- that worked. Thanks! Now, another issue- I have my .exe file, but it works only when in the /dis= t directory where I created it. If I move it to the desktop, it doesn't work. Do I have to make sure I keep all the components in the /dist directory with it? Thanks, Dan On 4/28/06, Phil Edwards <ph...@li...> wrote: > > On Friday 28 Apr 2006 03:42, Daniel Ryan wrote: > > All, > > > > I'm a newbie in the PythonCard world, and I'm encountering an error whe= n > I > > use py2exe to create a stand-alone executable. My error log looks like > > this: > > Traceback (most recent call last): > > File "GUI.py", line 555, in ? > > File "PythonCard\model.pyc", line 337, in __init__ > > File "PythonCard\resource.pyc", line 48, in getResource > > File "PythonCard\resource.pyc", line 86, in __init__ > > File "PythonCard\resource.pyc", line 91, in __init__ > > File "PythonCard\resource.pyc", line 91, in __init__ > > File "PythonCard\resource.pyc", line 96, in __init__ > > File "PythonCard\resource.pyc", line 139, in enforceSpec > > File "PythonCard\resource.pyc", line 30, in loadComponentModule > > ImportError: cannot import module 'staticline > > > > Anybody encounter this before/know the way to fix it? > > > > Yup - what you need to do is add a line into your code which explicitly > imports the required PythonCard components. For your GUI.py program, > you'll > need to add something like: > > from PythonCard.components import staticline, statictext, textarea, \ > button > > Since these are the components you've got in your GUI.rsrc.py file. Just > FYI, > I'm using your code to help debug the latest version of standaloneBuilder= , > with some help from Alex Tweedly. > > -- > > Regards > > Phil Edwards > Brighton, UK > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronim= o > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat= =3D121642 > _______________________________________________ > Pythoncard-users mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/pythoncard-users > -- Daniel Ryan (410) 271-9673 (cell) |
From: Phil E. <ph...@li...> - 2006-04-28 13:20:39
|
On Friday 28 Apr 2006 14:00, Daniel Ryan wrote: > Phil, > > Great- that worked. Thanks! > > Now, another issue- I have my .exe file, but it works only when in the > /dist directory where I created it. If I move it to the desktop, it > doesn't work. Do I have to make sure I keep all the components in the > /dist directory with it? > Yes, you do. That's why that folder is called 'dist' by default, because you have to distribute the contents in order to make your standalone version run on another computer. How you actually go about doing that is another whole discussion, although my preference is to use Inno Setup, which is a freeware software installer that you can download from: http://www.jrsoftware.org/isdl.php This packages up your program and all its supporting files into a single .EXE file which can be distributed to your end users. When they run it, your application is installed and an entry is added under Control Panel --> Add & Remove Software to allow the app to be un-installed easily as well. -- Regards Phil Edwards Brighton, UK |
From: Daniel R. <dv...@gm...> - 2006-04-28 14:09:55
|
Phil, Eureka- I'm done! That worked- thanks so much. Have a good one, Dan On 4/28/06, Phil Edwards <ph...@li...> wrote: > > On Friday 28 Apr 2006 14:00, Daniel Ryan wrote: > > Phil, > > > > Great- that worked. Thanks! > > > > Now, another issue- I have my .exe file, but it works only when in the > > /dist directory where I created it. If I move it to the desktop, it > > doesn't work. Do I have to make sure I keep all the components in the > > /dist directory with it? > > > > Yes, you do. That's why that folder is called 'dist' by default, because > you > have to distribute the contents in order to make your standalone version > run > on another computer. How you actually go about doing that is another whol= e > discussion, although my preference is to use Inno Setup, which is a > freeware > software installer that you can download from: > > http://www.jrsoftware.org/isdl.php > > This packages up your program and all its supporting files into a single > .EXE > file which can be distributed to your end users. When they run it, your > application is installed and an entry is added under Control Panel --> Ad= d > & > Remove Software to allow the app to be un-installed easily as well. > > -- > > Regards > > Phil Edwards > Brighton, UK > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronim= o > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat= =3D121642 > _______________________________________________ > Pythoncard-users mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/pythoncard-users > -- Daniel Ryan (410) 271-9673 (cell) |