By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,533 Members | 1,497 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,533 IT Pros & Developers. It's quick & easy.

pyinstaller fails to create exe-File

P: n/a
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\buildback up\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 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Di**********@mail.com 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\buildback up\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

Feb 23 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.