Thank you Alex!
As you said, I got a lot of error messages until I included every single =
component in "from Pythoncard.components import...".
If anyone is in the same situation, please bear in mind that all the =
components must be writen in lowercase in the import statement (it's =
"staticbox", not "StaticBox").
For example:
from PythonCard.components import statictext, imagebutton, =
textfield, textarea, list, etc...
Now it works!
Thanks again! I'm so happy...
Luis
----- Original Message -----=20
From: Alex Tweedly=20
To: Luis M. Gonzalez=20
Cc: pyt...@li...=20
Sent: Wednesday, June 28, 2006 9:42 PM
Subject: Re: [Pythoncard-users] py2exe error
Luis M. Gonzalez wrote:=20
Hi there,
I want to build an ".exe" for a Pythoncard app, but I always get the =
following log:
Traceback (most recent call last):
File "imc.pyw", line 43, 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 'image
I tried using the option "--excludes=3DImage", but the problem =
persists.
What else can I do?
The problem is that your app uses the PythonCard 'image' component - =
but py2exe hasn't realized that the component was needed. py2exe tries =
to figure out which files are imported in order to include them - but =
won't succeed with PythonCard components because they are not imported =
directly, but rather through the resource.py and the resource file.
(that may not be a perfect explanation - see the section on "Resolving =
import errors" in http://pythoncard.sourceforge.net/standalone.html )
easiest fix is to add =20
from PythonCard.components import image
to your app's main .py file. That will almost certainly then result in =
a similar error message, for each of the rest of the component types =
used - so you could short-circuit that by making it be
from PythonCard.components import image, button, textfield, ...
listing all the component types used in your resource file.
--=20
Alex Tweedly http://www.tweedly.net
-------------------------------------------------------------------------=
-----
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.5/377 - Release Date: =
27/06/2006
|