473,705 Members | 7,146 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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\m ich\job\abs\bac kup_skript\buil dbackup\out1.py z/
email", lin
e 79, in __getattr__
File "D:\Programme\p yinstaller\iu.p y", line 334, in importHook
raise ImportError, "No module named %s" % fqname
ImportError: No module named email.mime.mult ipart
""

My python-Skript uses the following imports:
import ConfigParser
import glob
import os
import smtplib
import time
import win32api
import zipfile
from email.MIMEMulti part 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\py thon25\lib\site-packages\py2exe \run.exe -E:
\Documents\m
ich\job\abs\bac kup_skript\dist \backup.exe
Traceback (most recent call last):
File "setup.py", line 4, in <module>
setup(console=["backup.py"])
File "d:\programme\p ython25\lib\dis tutils\core.py" , line 151, in
setup
dist.run_comman ds()
File "d:\programme\p ython25\lib\dis tutils\dist.py" , line 974, in
run_commands
self.run_comman d(cmd)
File "d:\programme\p ython25\lib\dis tutils\dist.py" , line 994, in
run_command
cmd_obj.run()
File "D:\programme\P ython25\Lib\sit e-packages\py2exe \build_exe.py",
line 223,
in run
self._run()
File "D:\programme\P ython25\Lib\sit e-packages\py2exe \build_exe.py",
line 290,
in _run
self.create_bin aries(py_files, extensions, dlls)
File "D:\programme\P ython25\Lib\sit e-packages\py2exe \build_exe.py",
line 548,
in create_binaries
arcname, target.script)
File "D:\programme\P ython25\Lib\sit e-packages\py2exe \build_exe.py",
line 788,
in build_executabl e
add_resource(un icode(exe_path) , script_bytes, u"PYTHONSCRIPT" , 1,
True)
RuntimeError: EndUpdateResour ce: 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 7646
Di**********@ma il.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\m ich\job\abs\bac kup_skript\buil dbackup\out1.py z/
email", lin
e 79, in __getattr__
File "D:\Programme\p yinstaller\iu.p y", line 334, in importHook
raise ImportError, "No module named %s" % fqname
ImportError: No module named email.mime.mult ipart
""

My python-Skript uses the following imports:
import ConfigParser
import glob
import os
import smtplib
import time
import win32api
import zipfile
from email.MIMEMulti part 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\py thon25\lib\site-packages\py2exe \run.exe -E:
\Documents\m
ich\job\abs\bac kup_skript\dist \backup.exe
Traceback (most recent call last):
File "setup.py", line 4, in <module>
setup(console=["backup.py"])
File "d:\programme\p ython25\lib\dis tutils\core.py" , line 151, in
setup
dist.run_comman ds()
File "d:\programme\p ython25\lib\dis tutils\dist.py" , line 974, in
run_commands
self.run_comman d(cmd)
File "d:\programme\p ython25\lib\dis tutils\dist.py" , line 994, in
run_command
cmd_obj.run()
File "D:\programme\P ython25\Lib\sit e-packages\py2exe \build_exe.py",
line 223,
in run
self._run()
File "D:\programme\P ython25\Lib\sit e-packages\py2exe \build_exe.py",
line 290,
in _run
self.create_bin aries(py_files, extensions, dlls)
File "D:\programme\P ython25\Lib\sit e-packages\py2exe \build_exe.py",
line 548,
in create_binaries
arcname, target.script)
File "D:\programme\P ython25\Lib\sit e-packages\py2exe \build_exe.py",
line 788,
in build_executabl e
add_resource(un icode(exe_path) , script_bytes, u"PYTHONSCRIPT" , 1,
True)
RuntimeError: EndUpdateResour ce: 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
4693
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 WinXP Pro machines. We have VBA code in an Access form to run regsvr32.exe to register TSISOON90.dll. When I am logged on as admin, this runs fine and registers the dll. However, when another user runs VBA code which relies on TSISOON, it fails,...
0
1510
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 successfully cross compiled to this netgear router although others have tried. what i'd like to do is get these scripts to run on the router. i saw
8
2431
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
2956
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: =================================== ProcessStartInfo psi = new ProcessStartInfo("date","/t"); psi.UseShellExecute = false; psi.RedirectStandardOutput = true; psi.RedirectStandardError = true; psi.CreateNoWindow = true; process = new Process();
0
1184
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 like-solution which runs on Linux would also be welcome. When PyInstaller works, it's pretty nice. When it doesn't, it is a real pain to figure out what the heck it doesn't like. So if anyone has a less painful alternative, which runs on Linux, please...
0
1683
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 build the targets: ../../support/loader/run ../../support/loader/run_d I can't find libpython2.5.a. Where can I download the "libpython2.5.a"?
0
1561
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 to overcome them. I tried COLLECT but the files don't seem to be added to the install. The reason is most likely, that I dont know, where to put the result of COLLECT: Is it pyz, is it exe, or...? Is anyone willing to post an example or two...
3
2967
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 pass its first block pointer inside the structure Array to Array ->first and the last block pointer inside the structure Array to Array ->last.So i can manipulate the double linked list as a dynamic array. The cells of this dynamic array are...
1
4793
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. Configure.py 2. Makespec.py -F <script>.py
2
6898
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 SPEED UP my executable ??? -Do you know some GOOD build switches?
0
8690
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9274
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9139
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8979
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7895
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5933
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4440
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2491
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2083
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.