I'm using:
Windows 10
Python 3.8.1
tkinter 8.6.3
cx_freeze 6.1
I am using cx_freeze with a setup.py file to compile my python script (Note: I also got PyInstaller to work - it has the same problem). It creates an exe that runs. Unfortunately, it also creates a "lib" directory that's over 26 MB (18 MB for PyInstaller) and is mostly unnecessary.
Examples:
libcrypto-1_1.dll (not using crypto, this takes up 2.2 MB)
unicodedata.pyd (not using unicode, this takes up 1 MB)
libssl-1_1.dll (not using ssl, this takes up >500 KB)
There is also a tkinter folder created with > 6 MB of files.
In that, there are the following subfolders:
tcl\encoding (~1.3 M) and has all kind of encoding I'm not using
tcl\msgs (~100K) with a bunch of useless msg files in different languages in it
tcl\tzdata (~1.3M) with time zone data I don't need
tk\demos (~720K) with demos I don't need
tk\images (~100K) with images I don't need
tk\msgs (~100K) with more msg files I don't need
tk\ttk (~120K) with themes I'm not using
...and a whole bunch of other files I suspect I don't need. This is a small script with a very small target audience (me and a handful of other users, portability is not required here). I have found and deleted useless files. I discover not needing them, by deleting them and seeing if my .exe file crashes or runs. Every time I update my program and recompile, it's regenerating the files. I'm keeping a list but I'm tired of checking what's changed, then finding and deleting the unnecessary files every time. How can I prevent these all from being created when I compile?