dose pyinstaller pack python module that not used? #6123
-
i project include a lib consistant of "server" and "client" part, i use "client" part and want to pack it to a single executable file, i wonder if it will pack "server" part? i do't want it to be leak or i will delete it manually from source code. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
That depends on what "not used" means. If the server part of the package is imported in any of the modules that your code ends up importing (or if those modules end up importing the server-related modules), the server part will get packaged as well (for example, if the package's top-level You can always check |
Beta Was this translation helpful? Give feedback.
That depends on what "not used" means. If the server part of the package is imported in any of the modules that your code ends up importing (or if those modules end up importing the server-related modules), the server part will get packaged as well (for example, if the package's top-level
__init__.py
imports both the server and the client side, both will be packaged).You can always check
build/<name>/Analysis-00.toc
(orPYZ-00.toc
) to see what python modules ended up collected. You could also explicitly exclude the server-related modules using--exclude-module
, but that will work only if they are conditionally imported in the modules that triggered their inclusion in the first place (oth…