pyinstaller fails to create exe-File

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

  1. 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\iu.py", 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
    python script.py
    works without any problems.

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

    copying d:\programme\python25\lib\site-packages\py2exe\run.exe -> E:
    \Documents\m
    ich\job\abs\backup_skript\dist\backup.exe
    Traceback (most recent call last):
    File "setup.py", line 4, in <module>
    setup(console=["backup.py"])
    File "d:\programme\python25\lib\distutils\core.py", line 151, in
    setup
    dist.run_commands()
    File "d:\programme\python25\lib\distutils\dist.py", line 974, in
    run_commands
    self.run_command(cmd)
    File "d:\programme\python25\lib\distutils\dist.py", line 994, in
    run_command
    cmd_obj.run()
    File "D:\programme\Python25\Lib\site-packages\py2exe\build_exe.py",
    line 223,
    in run
    self._run()
    File "D:\programme\Python25\Lib\site-packages\py2exe\build_exe.py",
    line 290,
    in _run
    self.create_binaries(py_files, extensions, dlls)
    File "D:\programme\Python25\Lib\site-packages\py2exe\build_exe.py",
    line 548,
    in create_binaries
    arcname, target.script)
    File "D:\programme\Python25\Lib\site-packages\py2exe\build_exe.py",
    line 788,
    in build_executable
    add_resource(unicode(exe_path), script_bytes, u"PYTHONSCRIPT", 1,
    True)
    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.

    Dierk
    , Feb 22, 2007
    #1
    1. Advertising

  2. schrieb:
    > 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\iu.py", 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
    > python script.py
    > works without any problems.


    There have been large changes to the email module in Python 2.5,
    see the NEWS.txt file. email's __init__.py 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.

    > I have also tried to use py2exe, but
    > python setup.py py2exe
    > gives the following error message:
    >
    > copying d:\programme\python25\lib\site-packages\py2exe\run.exe -> E:
    > \Documents\m
    > ich\job\abs\backup_skript\dist\backup.exe
    > Traceback (most recent call last):
    > File "setup.py", line 4, in <module>
    > setup(console=["backup.py"])
    > File "d:\programme\python25\lib\distutils\core.py", line 151, in
    > setup
    > dist.run_commands()
    > File "d:\programme\python25\lib\distutils\dist.py", line 974, in
    > run_commands
    > self.run_command(cmd)
    > File "d:\programme\python25\lib\distutils\dist.py", line 994, in
    > run_command
    > cmd_obj.run()
    > File "D:\programme\Python25\Lib\site-packages\py2exe\build_exe.py",
    > line 223,
    > in run
    > self._run()
    > File "D:\programme\Python25\Lib\site-packages\py2exe\build_exe.py",
    > line 290,
    > in _run
    > self.create_binaries(py_files, extensions, dlls)
    > File "D:\programme\Python25\Lib\site-packages\py2exe\build_exe.py",
    > line 548,
    > in create_binaries
    > arcname, target.script)
    > File "D:\programme\Python25\Lib\site-packages\py2exe\build_exe.py",
    > line 788,
    > in build_executable
    > add_resource(unicode(exe_path), script_bytes, u"PYTHONSCRIPT", 1,
    > True)
    > 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)


    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
    Thomas Heller, Feb 23, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. niclane
    Replies:
    0
    Views:
    616
    niclane
    Nov 22, 2005
  2. kbperry
    Replies:
    1
    Views:
    447
    Giovanni Bajo
    Apr 12, 2006
  3. Giovanni Bajo
    Replies:
    0
    Views:
    511
    Giovanni Bajo
    Jun 3, 2008
  4. oyster
    Replies:
    0
    Views:
    479
    oyster
    Oct 21, 2008
  5. Prapulla Kumar
    Replies:
    0
    Views:
    53
    Prapulla Kumar
    Jan 6, 2014
Loading...

Share This Page