472,354 Members | 2,131 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

py2exe compression not working with Python 2.5

When I try to compress the output of py2exe like this:

from distutils.core import setup
import py2exe

setup(console=['hello.py'], options={"py2exe": {"compressed": 1}})

I get strange error messages:

Adding zlib.pyd to C:\tests\CanControllerTest\New Folder
(2)\dist\library.zip
Traceback (most recent call last):
File "setup.py", line 4, in <module>
setup(console=['hello.py'], options={"py2exe": {"compressed": 1}})
File "C:\Python25\lib\distutils\core.py", line 151, in setup
dist.run_commands()
File "C:\Python25\lib\distutils\dist.py", line 974, in run_commands
self.run_command(cmd)
File "C:\Python25\lib\distutils\dist.py", line 994, in run_command
cmd_obj.run()
File "C:\Python25\lib\site-packages\py2exe\build_exe.py", line 218,
in run
self._run()
File "C:\Python25\lib\site-packages\py2exe\build_exe.py", line 285,
in _run
self.create_binaries(py_files, extensions, dlls)
File "C:\Python25\lib\site-packages\py2exe\build_exe.py", line 591,
in create_
binaries
bytes = zlib_file.read()
AttributeError: 'NoneType' object has no attribute 'read'

This is a standard Python 2.5 installation. Doing the same thing with
2.4 works like a charm.

Did I miss anything?

Sep 22 '06 #1
2 1829
nikie schrieb:
When I try to compress the output of py2exe like this:

from distutils.core import setup
import py2exe

setup(console=['hello.py'], options={"py2exe": {"compressed": 1}})

I get strange error messages:

Adding zlib.pyd to C:\tests\CanControllerTest\New Folder
(2)\dist\library.zip
Traceback (most recent call last):
File "setup.py", line 4, in <module>
setup(console=['hello.py'], options={"py2exe": {"compressed": 1}})
File "C:\Python25\lib\distutils\core.py", line 151, in setup
dist.run_commands()
File "C:\Python25\lib\distutils\dist.py", line 974, in run_commands
self.run_command(cmd)
File "C:\Python25\lib\distutils\dist.py", line 994, in run_command
cmd_obj.run()
File "C:\Python25\lib\site-packages\py2exe\build_exe.py", line 218,
in run
self._run()
File "C:\Python25\lib\site-packages\py2exe\build_exe.py", line 285,
in _run
self.create_binaries(py_files, extensions, dlls)
File "C:\Python25\lib\site-packages\py2exe\build_exe.py", line 591,
in create_
binaries
bytes = zlib_file.read()
AttributeError: 'NoneType' object has no attribute 'read'

This is a standard Python 2.5 installation. Doing the same thing with
2.4 works like a charm.

Did I miss anything?
Patches for this have been posted to the py2exe-users list.

Thomas

Sep 22 '06 #2
Thomas Heller wrote:
nikie schrieb:
When I try to compress the output of py2exe like this:

from distutils.core import setup
import py2exe

setup(console=['hello.py'], options={"py2exe": {"compressed": 1}})

I get strange error messages:

Adding zlib.pyd to C:\tests\CanControllerTest\New Folder
(2)\dist\library.zip
Traceback (most recent call last):
File "setup.py", line 4, in <module>
setup(console=['hello.py'], options={"py2exe": {"compressed": 1}})
File "C:\Python25\lib\distutils\core.py", line 151, in setup
dist.run_commands()
File "C:\Python25\lib\distutils\dist.py", line 974, in run_commands
self.run_command(cmd)
File "C:\Python25\lib\distutils\dist.py", line 994, in run_command
cmd_obj.run()
File "C:\Python25\lib\site-packages\py2exe\build_exe.py", line 218,
in run
self._run()
File "C:\Python25\lib\site-packages\py2exe\build_exe.py", line 285,
in _run
self.create_binaries(py_files, extensions, dlls)
File "C:\Python25\lib\site-packages\py2exe\build_exe.py", line 591,
in create_
binaries
bytes = zlib_file.read()
AttributeError: 'NoneType' object has no attribute 'read'

This is a standard Python 2.5 installation. Doing the same thing with
2.4 works like a charm.

Did I miss anything?
Patches for this have been posted to the py2exe-users list.
Doh, should have looked there first...

Thanks a lot!

Sep 22 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: Thomas Heller | last post by:
I'm currently working on a new version of py2exe, which will require Python 2.3 and later, because it uses the zipimport mechanism. Since py2exe is a distutils extension, and since C compilers...
1
by: Funduk | last post by:
Hello, So I've been playing with Python and Pygame for a while and I decided I wanted to make a real executable so I could send that stuff over to my friends to show off my <sarcasm>maad...
0
by: David Vaughan | last post by:
py2exe and Pmw problem ---------------------- I was really surprised not to find some faq setting out what to do to get py2exe working for a program using Pmw. I'm haemorrhaging time here, and...
11
by: Timothy Smith | last post by:
is it possible instead of py2exe putting all library's in a zip file, to just put them in a sub dir?
4
true911m
by: true911m | last post by:
Here's a little walkthrough to get py2exe up and running. I'm not an expert, so I can't help much with any problems you might have. This is what worked for me. The result here will be to convert...
0
by: Jimmy Retzlaff | last post by:
py2exe 0.6.6 released ===================== py2exe is a Python distutils extension which converts Python scripts into executable Windows programs, able to run without requiring a Python...
1
by: Jimmy Retzlaff | last post by:
py2exe 0.6.8 released ===================== py2exe is a Python distutils extension which converts Python scripts into executable Windows programs, able to run without requiring a Python...
0
by: Larry Bates | last post by:
Jimmy Retzlaff wrote: Everyone, Thanks for all your hard work on py2exe, it is greatly appreciated. -Larry Bates
0
by: Jimmy Retzlaff | last post by:
py2exe 0.6.9 released ===================== py2exe is a Python distutils extension which converts Python scripts into executable Windows programs, able to run without requiring a Python...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made but the http to https rule only works for...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it so the python app could use a http request to get...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...

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.