py2exe 0.5.0 (finally) released

T

Thomas Heller

**py2exe 0.5.0** (finally) released
===================================

py2exe is a Python distutils extension which converts python scripts
into executable windows programs, able to run without requiring a
python installation.

News

Python 2.3 is required, because the new zipimport feature is used.
The zipimport mechanism is able to handle the early imports of the
warnings and also the encodings module which is done by Python.

Creates a single directory, which must be deployed completely.

py2exe can create any number of console and gui executables in
this directory, plus optionally windows service exes, plus
optionally exe and dll com servers. The com servers can expose
one or more com object classes.

All pure Python files are contained in a single zip archive, which
is shared by all the executables. The zip archive may also be
used by programs embedding Python. Since extension modules cannot
be imported from zipfiles, simple pure Python loaders are included
in the zipfile which load the extensions from the file system
(without requiring that the directory is in sys.path).

It is now simple to build py2exe from the sources, provided you
have MSVC6 installed - there are no dependencies on win32all
sources.

The created executables are standard PE executable files now, no
longer is something appended to the exe portion.

Download from the usual location:

<http://starship.python.net/crew/theller/py2exe>

Many thanks to Mark Hammond who worked hard to improve the COM
support, and suggested and implemented a lot of the new features.

Enjoy,

Thomas
 
W

Wilk

Hi,

I just try this new release with the simple sample, it throw an
exception :

Traceback (most recent call last):
File "setup.py", line 34, in ?
console = ["hello.py"],
File "C:\PYTHON23\lib\distutils\core.py", line 149, in setup
dist.run_commands()
File "C:\PYTHON23\lib\distutils\dist.py", line 907, in run_commands
self.run_command(cmd)
File "C:\PYTHON23\lib\distutils\dist.py", line 927, in run_command
cmd_obj.run()
File "C:\PYTHON23\Lib\site-packages\py2exe\build_exe.py", line 197, in run
self.create_binaries(py_files, extensions, dlls)
File "C:\PYTHON23\Lib\site-packages\py2exe\build_exe.py", line 391, in create_
binaries
arcname, target.script)
File "C:\PYTHON23\Lib\site-packages\py2exe\build_exe.py", line 590, in build_e
xecutable
self.add_versioninfo(target, exe_path)
File "C:\PYTHON23\Lib\site-packages\py2exe\build_exe.py", line 609, in add_ver
sioninfo
from py2exe.resources.VersionInfo import Version, RT_VERSION
File "C:\PYTHON23\Lib\site-packages\py2exe\py2exe.py", line 3, in ?
raise RuntimeError, "something's wrong"
RuntimeError: something's wrong

hello.exe works indeed

I try it on win98 and winNT, with last python2.3.3

There is no unicode file do download for winNT ?

bye
 
C

Cousin Stanley

| http://starship.python.net/crew/theller/py2exe

Thomas ....

This is my first attempt at running any version of py2exe ....

Using ....

Win98_SE
Python 2.3 Enthought Edition
py2exe 0.50

The samples hello.py and test_wx.py in the simple folder
function as expected when run as python scripts ....

setup.py goes through the motions and creates
the build and dist directories and the following
files are produced in .... /simple/dist ....

hello.exe
library.zip
python23.dll
w9xpopen.exe
wxc.pyd
wxmsw24.dll
_sre.pyd

hello.exe will not run ....

Could not locate script resource:

The following Traceback from setup.py indicates
that unicows.dll seems to be missing ....

python setup.py py2exe > py2exe_simple.txt
Traceback (most recent call last):
File "setup.py", line 34, in ?
console = ["hello.py"],
File ".\distutils\core.py", line 149, in setup
File ".\distutils\dist.py", line 907, in run_commands
File ".\distutils\dist.py", line 927, in run_command
File "K:\PYTHON23\Lib\site-packages\py2exe\build_exe.py", line 197, in run
self.create_binaries(py_files, extensions, dlls)
File "K:\PYTHON23\Lib\site-packages\py2exe\build_exe.py", line 391, in create_
binaries
arcname, target.script)
File "K:\PYTHON23\Lib\site-packages\py2exe\build_exe.py", line 566, in build_e
xecutable
add_resource(unicode(exe_path), script_bytes, u"PYTHONSCRIPT", 1, True)
RuntimeError: this function requires unicows.dll in the Python directory on Win
95/98/Me

I found one version of unicows.dll that was previously installed
with another program, OE-Quote-fix, and stuck it in the Python folder,
but then Python page faulted from setup.py ....

Will a different/current version of unicows.dll
in the Python folder alieviate this problem ????
 
W

Wilk

I answer to myself, the problem was because i didn't remove an old
py2exe version in site-packages.

Bye

Wilk said:
Hi,

I just try this new release with the simple sample, it throw an
exception :

Traceback (most recent call last):
File "setup.py", line 34, in ?
console = ["hello.py"],
File "C:\PYTHON23\lib\distutils\core.py", line 149, in setup
dist.run_commands()
File "C:\PYTHON23\lib\distutils\dist.py", line 907, in run_commands
self.run_command(cmd)
File "C:\PYTHON23\lib\distutils\dist.py", line 927, in run_command
cmd_obj.run()
File "C:\PYTHON23\Lib\site-packages\py2exe\build_exe.py", line 197, in run
self.create_binaries(py_files, extensions, dlls)
File "C:\PYTHON23\Lib\site-packages\py2exe\build_exe.py", line 391, in create_
binaries
arcname, target.script)
File "C:\PYTHON23\Lib\site-packages\py2exe\build_exe.py", line 590, in build_e
xecutable
self.add_versioninfo(target, exe_path)
File "C:\PYTHON23\Lib\site-packages\py2exe\build_exe.py", line 609, in add_ver
sioninfo
from py2exe.resources.VersionInfo import Version, RT_VERSION
File "C:\PYTHON23\Lib\site-packages\py2exe\py2exe.py", line 3, in ?
raise RuntimeError, "something's wrong"
RuntimeError: something's wrong

hello.exe works indeed

I try it on win98 and winNT, with last python2.3.3

There is no unicode file do download for winNT ?

bye
 
C

Cousin Stanley

| ....
| python setup.py py2exe
| ....
| RuntimeError: this function requires unicows.dll in the Python directory
| on Win95/98/Me
| ....

Thomas ....

Google search found a MicroSoft download
for unicows.dll ....

http://www.microsoft.com/downloads/...d7-ed06-4f0d-80a4-2a7eeaee17e2&displaylang=en

A copy of this dll in the Python23 folder
has eliminated the problem and Windows executables
generated for .... /py2exe/samples/simple work as expected ....

Thanks for making py2exe available ....

Now I'm looking forward to learning how to use it ....
 
O

OPQ

Thomas Heller said:
**py2exe 0.5.0** (finally) released
py2exe is a Python distutils extension which converts python scripts
into executable windows programs, able to run without requiring a
python installation.
Enjoy,

Thomas



Great !
Works flawlessly for me.
The ptyhoncom support is much better for me.
Sometimes, in the past, py2exe would forget to include (because of me)
some pythoncom.dll.
Not anymore.


But anyway, there is a little annoying point: in the past (0.4.x),
while compiling, py2exe would turn all necessary files to pyc or pyo
in-place
And then, after 1 compilation step, it wouldn't do it anymore, but
just for the file which have changed.

Now, since it put all the file in the zip archive, It won't generate
..pyo files in-place, but only in the archive.
And thus, each time I compile py application, I see that py2exe
bye-compile stuff that didn't change, but do not exists in .pyo.



I may be wrong in my analyse, but that's how I see it.

Other stuff: for the same EXE, I have (totally arbitrary number)
8.6 Mb of data with py2exe 0.4
11.7 M with 0.5 (zipfile activated)

Try to explain that !


Anyway, great stuff, great samples to


---OPQ
 
R

R.Marquez

Maybe I'm missing it, but I don't see how to specify an icon to use
for the exe. Is that funtionality no longer available?

-Ruben
 
J

Josiah Carlson

Maybe I'm missing it, but I don't see how to specify an icon to use
for the exe. Is that funtionality no longer available?

-Ruben

Perhaps I'm not using the latest version, but --icon <icon file> seems
to work for me.

- Josiah
 
W

Wolfgang Strobl

(e-mail address removed) (R.Marquez):
Maybe I'm missing it, but I don't see how to specify an icon to use
for the exe. Is that funtionality no longer available?

icon_resources works for me, like so:

setup( windows = ["wxKnife.py",
{"script":"wxKnife.py","icon_resources":[(1,"images/app2.ico")]}],
console=["installed_updates.py","installed_sw.py"],
data_files=[("images",["images/app2.ico",]),]
)
 
R

R.Marquez

Wolfgang Strobl said:
icon_resources works for me, like so:

setup( windows = ["wxKnife.py",
{"script":"wxKnife.py","icon_resources":[(1,"images/app2.ico")]}],
console=["installed_updates.py","installed_sw.py"],
data_files=[("images",["images/app2.ico",]),]
)

That worked. I see that I need to visit the wiki page now. Thank you.

-Ruben
 
T

Thomas Heller

Wolfgang Strobl said:
icon_resources works for me, like so:

setup( windows = ["wxKnife.py",
{"script":"wxKnife.py","icon_resources":[(1,"images/app2.ico")]}],
console=["installed_updates.py","installed_sw.py"],
data_files=[("images",["images/app2.ico",]),]
)

That worked. I see that I need to visit the wiki page now. Thank you.

-Ruben

It is also in the samples\advanced, although commented out.

Thomas
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

py2exe 0.6.8 released 1
py2exe 0.6.9 released 0
py2exe 0.6.1 released 17
py2exe 0.6.6 released 0
py2exe 0.6.4 released 0
py2exe 0.6.5 released 0
py2exe 0.6.2 released 1
py2exe 0.5.4 released 5

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top