whenever i build python file to exe file from py2exe, it takes lots of space of minimum 25MB for small project also,it includes all the the python library file. Is there any other way that i can reduce the size.
A:
No, not really; you need Python shipped with the exe so that it is standalone. It it not common to create exe Files from Python projects, anyway.
Florian Mayer
2010-10-15 11:41:59
"not common" may be true of your computer. In any case it's irrelevant to the OP's question.
John Machin
2010-10-15 12:28:45
I was talking about the Python developer community, that it is not common practice to use py2exe. That does matter.
Florian Mayer
2010-10-15 12:31:03
+2
A:
Python programs need python to run. All py2exe does is to include full python and all libraries you use together with your script in a single file.
nosklo
2010-10-15 11:43:28
"""all libraries you use""" ... yeah, and often many libraries that you don't use -- see the reference given by @ghostdog74.
John Machin
2010-10-15 12:26:59
+4
A:
You should have read the documentation before using. Here's a page you can read
ghostdog74
2010-10-15 11:45:04
A:
py2exe tends to err on the side of caution. You can manually exclude some libraries with the exclude
list option in order to reduce the size of the file.
In my experience, you should be able to compress down to a ~9 MB installer (Inno) if you include wxPython or another GUI framework, ~7 MB if you ship a console app or use tkinter.
Ryan Ginstrom
2010-10-15 11:46:34
But then, why not install Python properly in the installation procedure, when you use an installer, and let py2exe be?
Florian Mayer
2010-10-15 12:35:02
@Florian: Because the average Windows user is going to have a hard time installing Python in order to use your software. I've dealt with the problem many times. Even when they manage to install Python, getting them to navigate the command line is a challenge.
Ryan Ginstrom
2010-10-15 15:05:40
You can make your installer install Python for them and link directly to the main .py file.
Florian Mayer
2010-10-15 15:23:43
If you have a savvy user, then fine. But if your user doesn't know Python from a turnip (and most Windows users don't), then expecting them to handle the package management of a normal Python install is simply not realistic.
Ryan Ginstrom
2010-10-19 13:07:42