-
-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Too much unecessary file in creating .exe
#2118
Comments
After some investigations, the only module that must be exist are only All
|
I'm not associated with the project, so I'm just guessing here. But the trimming down of the stdlib would require analyzing imports of not only the program being freezed, but also, any 3rd party dependencies it may depend on, which a) is a non trivial task and b) I don't think cx_Freeze does. It would be a worthy goal, but is probably also a lot of work. For my own work I have similar size issues, but they are directly related to DLLs in a 3rd party package "PySide". Including all the DLLs (which I think is cx_Freeze default) of that, makes even simple PySide program several hundreds of megabytes in size, but again, going in and analyzing all PySide imports in my code and in all dependencies and coupling those Python imports to DLLs is non-trivial to say the least. It is worth noting that a project like nuitka actually does something along those lines (at least it cuts down the bundled DLL's I don't know about stdlib), but it is a very different beast, so I don't know if it can be used for inspiration. |
@yasirroni Sorry for the late reply. |
To Reproduce
I'm trying to understand what happens under the hood of
cx_freeze
. Simple example of Python codeDefault run is using:
cxfreeze cx_freeze/hello_world.py --target-dir cx_freeze/dist
But, that tooks too long. Using exhaustive excludes, I can use:
cxfreeze cx_freeze/hello_world.py --target-dir cx_freeze/dist --exclude-modules asyncio,concurrent,ctypes,distutils,email,html,http,lib2to3,logging,multiprocessing,pydoc_data,pywin32_system32,tcl8,tcl8.6,test,tkinter,unittest,urllib,xml,xmlrpc
.The second command is bot faster and smaller in size. Both
.exe
works.Expected behavior
Why so many packages and module that is not related is copied in creating the
.exe
?Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: