How to exclude DLLs in subdirectories? #1051
-
Hi, I’d like to bundle a PyQt5-based application for deployment on Windows and would like to cut down the package size (currently about 200 MiB) by excluding some unused DLLs (about 45 MiB in total). These get placed in I tried these variants:
But none of them seemed to work. Is there a way to make this work, other than deleting them after the build using a batch script? Update 1All attempts were unsuccessful, so I started digging in the cx_freeze source code. I added this to from pathlib import Path
log_file = Path("C:/Users/Thomas/freeze.txt")
def log(s: Any):
with log_file.open("at") as f:
print(s, file=f) And then logged each file passed to This is the result:
As can be seen, the requested libs (e.g. Update 2It seems my initial question was misguided. cx_freeze copies the whole PyQt5 site-package directory, including everything in there. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
The most propably is: |
Beta Was this translation helpful? Give feedback.
-
In the previous answer, I missed a point. The path of bin_excludes should be the full file name of the source binary (dll) or the base name of the binary. Not the relative target. Source: https://github.com/marcelotduarte/cx_Freeze/blob/main/cx_Freeze/freezer.py#L314
|
Beta Was this translation helpful? Give feedback.
-
I totally forgot to report back, sorry. The root cause here was that PyQt5 includes the Qt5 distribution in the site-packages under PyQt5/Qt5, which in turn contains many files I don’t want to package, like plugins and unused DLLs. I’m using the suggested |
Beta Was this translation helpful? Give feedback.
I totally forgot to report back, sorry.
The root cause here was that PyQt5 includes the Qt5 distribution in the site-packages under PyQt5/Qt5, which in turn contains many files I don’t want to package, like plugins and unused DLLs.
I’m using the suggested
'skip_build': True
option and a manual cleanup script that simply deletes all unwanted files from the distribution before packaging.