Thanks, Werner, using
.... 'py2exe': {
                        'packages' :    ['email'],
.......
actually worked

By the way, I didnt found the way to reply to your mail in the userlist instead of sending a new mail from hotmail... Im a piece of a nut...

Joaquin


From:
To: py2exe-users@lists.sourceforge.net
Date: Mon, 28 Apr 2008 15:48:10 +0000
Subject: [Py2exe-users] problems with email.MIMEText

Hello,
I get an error when I try to run an exe file from a program that imports python email modules
I simplified the code to a two lines program that is able of producing the error:

*** program test_mail_py2exe.py:

from email.MIMEText import MIMEText
print 'Hello'



This program run perfectly in the IDE and prints 'Hello'. When I compile it with py2exe to get test_mail_py2exe.exe and I execute it., it doesn't starts and produce the following error:

Traceback (most recent call last):
  File "test_mail_py2exe.py", line 1, in <module>
  File "email\__init__.pyo", line 79, in __getattr__
ImportError: No module named text


The same program (the big one) written not using the email module but the MimeWriter, mimetypes, mimetools, etc modules compiles and works perfectly.
However I'm not confortable with this solution because  these modules are being deprecated and email is the recommended one instead.
It seems the problem comes from the translation of old version module names in email to the new ones that takes place in __init__.py in the email package.

Please, some solution/fix?



The setup.py code  is below. I tried the 'includes' directive for email with no succes. Including MIMEText gaves an import error.

# exWx/setup.py
from distutils.core import setup
import py2exe

setup(
    console=[ {'script': "test_mail_py2exe.py"} ],
           
    options={ 'py2exe': {'excludes':     ['Tkconstants','Tkinter', 'tcl'],
                         'ignores':       ['wxmsw26uh_vc.dll'],
                         'dll_excludes': ['libgdk_pixbuf-2.0-0.dll',
                                         'libgdk-win32-2.0-0.dll',
                                         'libgobject-2.0-0.dll'
                                        ],
                        'compressed': 1,
                        'optimize':2,
                        'bundle_files': 1
                        }
            },
    zipfile = None,
    data_files= []
    )




Sigue los principales acontecimientos deportivos en directo. MSN Motor


Sigue de cerca las últimas tendencias y lo que más rompe MSN Vídeo