Is it possible to include the entire standard lib? #8901
-
I know this is a niche use case but I've came to a problem where I need to allow users to dynamically load plugins and if the main program hasn't imported a module from the standard lib then they won't have access to it. I've played around with adding hidden imports in a module and in the spec file using both https://pypi.org/project/stdlib-list/#:~:text=This%20package%20includes%20lists%20of,don't%20need%20this%20library and from 3.10 on built in python methods. However, this will include some but not all libs causing failures. Is this possible? Note: im bundling in one dir mode |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
There's no built-in option for that, but it should be doable via
What modules do you end up missing if you use the lists from Whereas |
Beta Was this translation helpful? Give feedback.
There's no built-in option for that, but it should be doable via
hiddenimports
in a way that you already attempted.What modules do you end up missing if you use the lists from
stdlib-list
? Those seem to include both top-level stdlib modules/packages and their submodules.Whereas
sys.stdlib_module_names
seems to include only top-level module/package names, so you might need to combine it withPyInstaller.utils.hooks.collect_submodules
(while explicitly exemptingthis
andantigravity
).