Python - Py2exe 无法使用“电子邮件"模块构建 .exe [英] Python - Py2exe can't build .exe using the 'email' module

查看:38
本文介绍了Python - Py2exe 无法使用“电子邮件"模块构建 .exe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

py2exe 不适用于标准电子邮件模块

py2exe does not work with the standard email module

你好.我正在尝试使用 py2exe 将脚本转换为 exe.构建过程显示了这一点:

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

似乎缺少以下模块

可执行文件不起作用.不包括引用的模块.我在互联网上研究了这个,我发现py2exe在标准lib电子邮件模块中使用的Lazy import有问题.不幸的是,我没有成功找到解决此问题的方法.有人可以帮忙吗?

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?

谢谢,

附言脚本中的导入如下所示:

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

代码:全选导入字符串、时间、系统、操作系统、smtplib从 email.MIMEMultipart 导入 MIMEMultipart从 email.MIMEBase 导入 MIMEBase从 email.MIMEText 导入 MIMEText从电子邮件导入编码器

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

推荐答案

如果您不必使用 py2exe,那么 bbfreeze 效果更好,我已经尝试使用电子邮件模块.http://pypi.python.org/pypi/bbfreeze/0.95.4

If you don't have to work with py2exe, bbfreeze works better, and I've tried it with the email module. http://pypi.python.org/pypi/bbfreeze/0.95.4

这篇关于Python - Py2exe 无法使用“电子邮件"模块构建 .exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆