开发者

PyInstaller error with email module

开发者 https://www.devze.com 2023-02-07 10:07 出处:网络
First create a scrip开发者_如何学Got named test.py, with one line in it: from email.MIMEMultipart import MIMEMultipart

First create a scrip开发者_如何学Got named test.py, with one line in it:

from email.MIMEMultipart import MIMEMultipart

Save it and run makespec.py and build.py, then I get the test.exe. This is what I get while running 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

Looks like PyInstaller doesn't work well with the email module. I've tried PyInstaller 1.4, 1.5rc, and the latest trunk, none of them worked. Windows Server 2003 /w Python 2.6 here. Any way to get around with this?


I should use from email.mime.multipart import MIMEMultipart.

It has been answered in the mailgroups ages ago, and it was the first hit when I google "pyinstaller, email". It's such a shame I didn't check it more carefully.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号