[GH-ISSUE #111] .exe size difference between pyinstaller and auto-py-to-exe #105

Closed
opened 2026-02-26 12:20:30 +03:00 by kerem · 2 comments
Owner

Originally created by @timellado on GitHub (Jul 30, 2020).
Original GitHub issue: https://github.com/brentvollebregt/auto-py-to-exe/issues/111

Hello,

I´ve a question about how auto-py-to-exe make the .exe file in the onedir mode, as I have run the same command in raw PyInstaller and auto-py-to-exe, and the .exe file generated in auto-py-to-exe is 2 mb heavier. Also, it´s estrange that the heavy file (auto-py-to-exe) is working fine and the one generated by pure PyInstaller is not, sending me an import error.
I also run the auto-py-to-exe, extract its spec file from the temporary folder, run this spec file in cmd using PyInstaller and also it fails when running the .exe, having the issue that the .exe file is 2mb lighter than the one generated using auto-py-to-exe.
Do you have any idea of what can be making the .exe file in auto-py-to-exe being heavier?
As a fact, if I copy the .exe file generated by auto-py-to-exe and replace the .exe in the folder generated by PyInstaller, the script works.

Folder generated with auto-py-to-exe

image

Folder generated with PyInstaller

image

Also, do you know a way in auto-py-to-exe to remove some binary files generated in the onedir folder? the way to do it with PyInstaller is for example in the spec file writing:

A = Analysis(...)
a.binaries = a.binaries - TOC([ ('some.dll', None, None), ('another.dll', None, None) ])
Can I do this in auto-py-to-exe?

BR,
Tomás Mellado

Originally created by @timellado on GitHub (Jul 30, 2020). Original GitHub issue: https://github.com/brentvollebregt/auto-py-to-exe/issues/111 Hello, I´ve a question about how auto-py-to-exe make the .exe file in the onedir mode, as I have run the same command in raw PyInstaller and auto-py-to-exe, and the .exe file generated in auto-py-to-exe is 2 mb heavier. Also, it´s estrange that the heavy file (auto-py-to-exe) is working fine and the one generated by pure PyInstaller is not, sending me an import error. I also run the auto-py-to-exe, extract its spec file from the temporary folder, run this spec file in cmd using PyInstaller and also it fails when running the .exe, having the issue that the .exe file is 2mb lighter than the one generated using auto-py-to-exe. Do you have any idea of what can be making the .exe file in auto-py-to-exe being heavier? As a fact, if I copy the .exe file generated by auto-py-to-exe and replace the .exe in the folder generated by PyInstaller, the script works. ### Folder generated with auto-py-to-exe ![image](https://user-images.githubusercontent.com/26118775/88911131-adecf300-d25d-11ea-89f2-364391bbf546.png) ### Folder generated with PyInstaller ![image](https://user-images.githubusercontent.com/26118775/88911101-a2013100-d25d-11ea-906b-b16be42ace9f.png) Also, do you know a way in auto-py-to-exe to remove some binary files generated in the onedir folder? the way to do it with PyInstaller is for example in the spec file writing: ` A = Analysis(...)` **`a.binaries = a.binaries - TOC([ ('some.dll', None, None), ('another.dll', None, None) ]) `** Can I do this in auto-py-to-exe? BR, Tomás Mellado
kerem closed this issue 2026-02-26 12:20:30 +03:00
Author
Owner

@brentvollebregt commented on GitHub (Jul 31, 2020):

I tried this comparison myself on a small Python script and the output differed by 53 bytes in an almost 13MB build output. Is there any chance that auto-py-to-exe and the PyInstaller you used to test this are in different Python distributions? If so, you may have had unnecessary modules added (just because they existed in the environment).

In terms of removing binaries, it appears the PyInstaller does not have an option in it's CLI so this tool does not support that unfortunately. To get around this we would need to generate spec files - this tool currently uses the CLI.

<!-- gh-comment-id:666981787 --> @brentvollebregt commented on GitHub (Jul 31, 2020): I tried this comparison myself on a small Python script and the output differed by 53 bytes in an almost 13MB build output. Is there any chance that auto-py-to-exe and the PyInstaller you used to test this are in different Python distributions? If so, you may have had unnecessary modules added (just because they existed in the environment). In terms of removing binaries, it appears the PyInstaller does not have an option in it's CLI so this tool does not support that unfortunately. To get around this we would need to generate spec files - this tool currently uses the CLI.
Author
Owner

@timellado commented on GitHub (Aug 4, 2020):

Yeah, at the end I just used the .spec as deleting binaries was a key aspect for me. Anyways nice work with this super helpful tool! make me understand a lot of thing about PyInstaller!
Best Regards!

<!-- gh-comment-id:668516808 --> @timellado commented on GitHub (Aug 4, 2020): Yeah, at the end I just used the .spec as deleting binaries was a key aspect for me. Anyways nice work with this super helpful tool! make me understand a lot of thing about PyInstaller! Best Regards!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/auto-py-to-exe#105
No description provided.