Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 电子邮件模块出现PyInstaller错误_Python_Email_Pyinstaller - Fatal编程技术网

Python 电子邮件模块出现PyInstaller错误

Python 电子邮件模块出现PyInstaller错误,python,email,pyinstaller,Python,Email,Pyinstaller,首先创建一个名为test.py的脚本,其中有一行: from email.MIMEMultipart import MIMEMultipart 保存它并运行makespec.py和build.py,然后我得到test.exe。这是我在运行test.exe时得到的结果: F:\SW\trunk\test\dist>test.exe Traceback (most recent call last): File "<string>", line 1, in <modul

首先创建一个名为
test.py
的脚本,其中有一行:

from email.MIMEMultipart import MIMEMultipart
保存它并运行
makespec.py
build.py
,然后我得到
test.exe
。这是我在运行
test.exe
时得到的结果:

F:\SW\trunk\test\dist>test.exe
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "test\build\pyi.win32\test\outPYZ1.pyz/email", line 79, in __getattr__
  File "F:\SW\trunk\iu.py", line 455, in importHook
    raise ImportError, "No module named %s" % fqname
ImportError: No module named email.mime.multipart
F:\SW\trunk\test\dist>test.exe
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
文件“test\build\pyi.win32\test\outPYZ1.pyz/email”,第79行,在\uuu getattr中__
文件“F:\SW\trunk\iu.py”,第455行,在importHook中
“没有名为%s”%fqname的模块”
ImportError:没有名为email.mime.multipart的模块

看起来PyInstaller不能很好地与电子邮件模块配合使用。我试过PyInstaller 1.4、1.5rc和最新的trunk,它们都不起作用。这里是WindowsServer2003/Wpython2.6。有没有办法解决这个问题?

我应该使用email.mime.multipart import MIMEMultipart中的

很久以前它就出现在邮件组中了,这是我在谷歌搜索“pyinstaller,email”时第一次点击。真遗憾,我没有仔细检查