I want to remove several redundant pre-production modules. So I try this but it doesn't work:
for module in sys.modules:
if 'outlook_preprod' in module:
del module
because then I can still see them:
for module in sys.modules:
if 'outlook_preprod' in module:
print(module)
outlook_preprod_v1
outlook_preprod_v2
How can I fix this error?