문제

First create a script 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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top