Python - Py2exe can't build .exe using the 'email' module
Question: py2exe does not work with the standard email module

Hello. I am trying to use py2exe for converting a script into an exe. The
build process shows this:

* * *

The following modules appear to be missing

## ['email.Encoders', 'email.Generator', 'email.Iterators', 'email.MIMEBase',
'email.MIMEMultipart', 'email.MIMEText', 'email.Utils', 'email.base64MIME']

The executable does not work. The referenced modules are not included. I
researched this on the Internet and I found out that py2exe has a problem with
the Lazy import used in the standard lib email module. Unfortunately I have
not succeeded in finding a workaround for this problem. Can anyone help?

Thank you,

P.S. Imports in the script look like this:

Code: Select all import string,time,sys,os,smtplib from email.MIMEMultipart
import MIMEMultipart from email.MIMEBase import MIMEBase from email.MIMEText
import MIMEText from email import Encoders


Answer: Have a look at this question [how-to-package-twisted-program-with-
py2exe](http://stackoverflow.com/questions/169897/how-to-package-twisted-
program-with-py2exe) it seems to be the same problem.

The answer given there is to explicitly include the modules on the command
line to py2exe.

