pyinstaller: adding dynamically loaded modules
问题 I'm trying to use Pyinstaller to bundle a server written in Python3. Part of the server code was written in a way that some modules are dynamically loaded like this: mod_files = [f for f in os.listdir(path)]: for f in mod_files: mod = importlib.import_module(mod_name) How do I handle these files with Pyinstaller? 回答1: Pyinstaller (currently v 3.4) can't detect imports like importlib.import_module() . The issue and solutions are detailed in Pyinstaller's documentation, which I pasted below as