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.
-
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.
John Machin : "not common" may be true of your computer. In any case it's irrelevant to the OP's question.Florian Mayer : I was talking about the Python developer community, that it is not common practice to use py2exe. That does matter. -
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.
John Machin : """all libraries you use""" ... yeah, and often many libraries that you don't use -- see the reference given by @ghostdog74. -
You should have read the documentation before using. Here's a page you can read
: thank you very much!!!.. -
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.
Florian Mayer : But then, why not install Python properly in the installation procedure, when you use an installer, and let py2exe be?Ryan Ginstrom : @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.Florian Mayer : You can make your installer install Python for them and link directly to the main .py file.Ryan Ginstrom : 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.
0 comments:
Post a Comment