473,378 Members | 1,564 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,378 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 7611
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.