2015-03-03 51 views
1

编译时,我有一个Python脚本,的Python:错误与py2exe

import email 
import email.mime.application 
... 
msg = email.mime.Multipart.MIMEMultipart() 
    msg['Subject'] = 'test' 
    msg['From'] = '[email protected]' 
    msg['To'] = '[email protected]' 
body = email.mime.Text.MIMEText("""test""") 

.... 

在Python脚本运行以及发送电子邮件, 但在我与py2exe编译它,我得到这个错误

Traceback (most recent call last): 
    File "mail.py", line 13, in <module> 
    File "email\__init__.pyc", line 79, in __getattr__ 
ImportError: No module named multipart 

在py2exe编译日志我看到这则消息

... 
The following modules appear to be missing 
['_scproxy', 'email.MIMEBase', 'email.MIMEMultipart', 'email.MIMEText'] 
.... 

任何想法如何解决这个问题? 谢谢

+0

只要安装使用PIP或easy_install的 – ForceBru 2015-03-03 11:03:39

+0

我新的Python缺少的模块,我安装了点子,下一步该怎么做看看?什么是语法来安装缺少的模块 – Roco20099 2015-03-03 11:19:17

+0

'pip安装模块' – ForceBru 2015-03-03 11:20:36

回答