pyinstaller fails to create exe-File

Discussion in 'Python' started by DierkErdmann, Feb 22, 2007.

  1. DierkErdmann

    DierkErdmann Guest

    Hi !

    I am trying to create an exe file using pyinstaller. Running the
    created exe-File gives the error message
    Traceback (most recent call last):
    File "<string>", line 8, in <module>
    File "E:\Documents\mich\job\abs\backup_skript\buildbackup\out1.pyz/
    email", lin
    e 79, in __getattr__
    File "D:\Programme\pyinstaller\", line 334, in importHook
    raise ImportError, "No module named %s" % fqname
    ImportError: No module named email.mime.multipart

    My python-Skript uses the following imports:
    import ConfigParser
    import glob
    import os
    import smtplib
    import time
    import win32api
    import zipfile
    from email.MIMEMultipart import MIMEMultipart
    from email.MIMEBase import MIMEBase
    from email.MIMEText import MIMEText
    from email.Utils import COMMASPACE, formatdate
    from email import Encoders

    Can someone help? Running
    works without any problems.

    I have also tried to use py2exe, but
    python py2exe
    gives the following error message:

    copying d:\programme\python25\lib\site-packages\py2exe\run.exe -> E:
    Traceback (most recent call last):
    File "", line 4, in <module>
    File "d:\programme\python25\lib\distutils\", line 151, in
    File "d:\programme\python25\lib\distutils\", line 974, in
    File "d:\programme\python25\lib\distutils\", line 994, in
    File "D:\programme\Python25\Lib\site-packages\py2exe\",
    line 223,
    in run
    File "D:\programme\Python25\Lib\site-packages\py2exe\",
    line 290,
    in _run
    self.create_binaries(py_files, extensions, dlls)
    File "D:\programme\Python25\Lib\site-packages\py2exe\",
    line 548,
    in create_binaries
    arcname, target.script)
    File "D:\programme\Python25\Lib\site-packages\py2exe\",
    line 788,
    in build_executable
    add_resource(unicode(exe_path), script_bytes, u"PYTHONSCRIPT", 1,
    RuntimeError: EndUpdateResource: Das System kann das angegebene Gerõt
    oder die a
    ngegebene Datei nicht ÷ffnen. (=System cannot find the specified
    device or the file)

    Thanks in advance.

    DierkErdmann, Feb 22, 2007
    1. Advertisements

  2. There have been large changes to the email module in Python 2.5,
    see the NEWS.txt file. email's module does some import
    hacks to ensure compatibility with previous versions, unfortunately
    the packagers cannot handle them automatically. It /may/ be possible
    to write a package hook for pyinstaller, I do not know.

    For py2exe at least, the best solution currently is to include the whole
    email package; this can be done with '-p email' on the command line, or
    by passing the corresponding option to the setup function.
    That's a different problem; it has nothing to do with the email package.
    You should try to clean the dist and build directories that py2exe creates,
    sometimes this helps. If it still does not work, you should try to find
    out what the error means. Is the file readonly? locked because still in use?

    Thomas Heller, Feb 23, 2007
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.