Pyinstaller size changes without any apparent reason

Viewed 16

I have a python script using tensorflow, websockets and some other libraries. The problem is when I create a onefile .exe file with pyinstaller which results in a very large size (About 530Mb). Now, I know this is mainly because of Tensorflow, and I am also using a virtual environment, so only the necessary libraries are being packed in the .exe file but for some reason, sometimes when I do a small change in the code an build it again using the same .spec file, importing the same libraries and not even deleting the __pycache__ or the build folders, the .exe file created is way smaller (about 345Mb). I have no idea why this happens and when does this happens. Does anyone has an idea of why this can happen?

PS. I am using pyinstaller 4.10 and pyinstaller-hooks-contrib 2022.2 I tried changing the pyinstaller version, but it does not help on reducing the size of the .exe file

0 Answers
Related