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.
4 Answers
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.
1 Comment
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.
4 Comments
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.