Basic question on application generated by Pyinstaller

35 views
Skip to first unread message

Aniruddha Shevade

unread,
Jan 24, 2020, 1:11:13 PM1/24/20
to PyInstaller
Hi
 Please excuse me if this is a basic question. I am new to Pyinstaller.
I am running Pyinstaller to generate an executable on windows.
It does appear that for the same python script based on the environment i am using , it produces the executable of different size.

This is what i have done

1) Use Pyinstaller under Miniconda with Python 2.7 
2) Use Pyinstaller with  Miniconda with Python 3.5.4

For each of these case for the same script file, we get a exe of different size and also the dist folder contains diferent contents 

I am not sure if this is expected ?  How do i know if the application is correctly built? I

thanks for any help

Best Regards
Ani

Steve Barnes

unread,
Jan 25, 2020, 4:31:16 AM1/25/20
to pyins...@googlegroups.com

Hi,

 

Yes it is to be expected that building executables in different environments will result in different size and content executables.

The way to be sure that your built application was correctly built is to run the tests that you have written for your code – ideally on another machine or a Virtual Machine that has never had python/anaconda installed. You can get free official VMs from https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/ - personally I would go for the VirtualBox VM.

 

Steve Barnes

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyinstaller...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/cc10ab42-6160-4fb3-be84-3bf556c368c3%40googlegroups.com.

Aniruddha Shevade

unread,
Jan 26, 2020, 9:50:02 AM1/26/20
to pyins...@googlegroups.com
Hi Steve
   Thanks for the response. Coming from a Java background, this is new to me. The script being compiled, should pick up exactly the same packages it needs in either environment. Why should its size differ ? And also why would the dist folder contain different contents in each case.
I would think just the needed packages should be packaged ( the versions of which might be different ) . But why would it package , DLLs which it does not  need 

Anyway , it does look like being a newbie   i have more to learn here. Thanks for your response, greatly appreciated.

Best Regards
Ani

Steve Barnes

unread,
Jan 26, 2020, 1:06:08 PM1/26/20
to pyins...@googlegroups.com

Hi Ani,

 

You to explain what pyinstaller is doing and why the sizes differ, in broad pyinstaller compiles (to byte code) the python source files, finds the libraries that are being used and bundles it all up into, effectively, zip file which is attached to a copy of the python executable in question itself and at least some of the base set of libraries (I am guessing about the base libraries being automatically included even if they aren’t used but that is the way that I would do it).  

 

Now the python executable under 2.7-32 is 27,136 bytes on my system 3.8-32 is 97,352 bytes so that is a start. I would also expect differences in the sizes of the libraries. Plus, of course, the minimum set of base libraries will possibly differ between versions and some of your installed choices may well hook themselves in as well which will result in different file inclusion choices.

 

Steve

Reply all
Reply to author
Forward
0 new messages