The amount of memory consumed by one imported module will be no less than the size of the module on disk. The overhead is determined by the OS itself (to load the dynamic module) and Python overhead when importing the module.
So, if your module has an average size of 100 KB, then importing out of 10,000 of them will take at least 1 GB of address space. Importing 50,000 of them will work on more than 5 GB. It is better to use an operating system with 64-bit address space.
Greg hewgill
source share