473,405 Members | 2,160 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

pyinstaller fails to create exe-File

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
1 7618
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: C Martin | last post by:
For some time, I have been using TSISOON90.dll, a free Access COM Add-in from Trigeminal Software which closes one db and opens another, plus other useful tasks. We recently installed some new...
0
by: niclane | last post by:
Hi, I have some python scripts, I need to run a netgear router, i have a cross compilation setup that works for c code no problem. the python interpreter doesn't appear to have been...
8
by: LittlePython | last post by:
Is it possible when using packages like PyInstaller to create an .exe for distribution that parts of the package can bleed out and be left on a system when the .exe is executed? Thx
7
by: =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post by:
I am attempting to fetch data from an external process. It seems to work OK with regular arguments, but not with switch arguments. Here is an example of a failure:...
0
by: Greg Copeland | last post by:
Anyone had any luck on using PyInstaller to package up Pygame? I posted to the PyInstaller group some time ago and have yet to receive a reply. Anyone have any tips to offer here? A...
0
by: linea | last post by:
When I install PyInstaller, it has some error. cd source/linux python ./Make.py Warning: could not find python static library at :/usr/lib/python2.5/config/libpython2.5.a Now run "make" to...
0
by: Thin Myrna | last post by:
I gave PyInstaller a shot and was pleased by the results so far. The usual problems occurred with missing data and icon files (the latter for splash screens only). However, it's a bit hard for me...
3
by: dreiko466 | last post by:
(sorry about my english...) I am a newbie in C (3 month expierience) I have wrote a simple test programm in VS2005, what i do wrong?Please... In this programm i create a double linked list.Then ...
1
by: Mark Delon | last post by:
Hi, I need to generate single EXEcutable via PyInstaller. It will be genereated -i get one single executable. AFTER CALL (exe) I get an error: "no module named _gt" Build command: 1....
2
by: Mark Delon | last post by:
Hi, My Python executable created with PyInstaller is too slow by starting... It takes about 15 secs.!!! I am using PyQt4 libraries for creating my very simple GUI-application. -How can I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.