Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

py2exe: Reduce size of the library archive

Tags:

python

py2exe

I just created my first py2exe executable and noticed that with the EXE, there is a ZIP file created with the size of around 1.4 MB.

My question is, can I reduce the size of this or is it expected that the typical size of an EXE generated with py2exe will be ~ 4 MB (that means with all the files: python2.6dll, library.zip)

like image 395
user225312 Avatar asked Aug 20 '10 06:08

user225312


2 Answers

Short answer to your size reduction question is yes. Long answer I am not going to provide here, but instead direct you to py2exe's OptimizingSize wiki page.

I hope this helps ;)

like image 141
plaes Avatar answered Nov 06 '22 12:11

plaes


After changing those setup.py parameters i also run UPX on DLLs and executables and repack library.zip with 7-zip, works well.

By the way, there is a page on the wiki about using UPX and 7-zip.

like image 23
fn. Avatar answered Nov 06 '22 12:11

fn.