Possible Duplicate:
Unload a module in Python
After importing Numpy, lets say I want to delete/remove numpy import reference
import sys import numpy as np doMe() np.something() #unimport np #remove numpy from memory
To remove an imported module in Python: Use the del statement to delete the sys reference to the module. Use the del statement to remove the direct reference to the module.
You can use https://pypi.org/project/unimport/, it can find and remove unused imports for you.
Yes, you can import a class twice in Java, it doesn't create any issues but, irrespective of the number of times you import, JVM loads the class only once.
Unloading a module from Python is not supported.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With