Is there any way to unimport a library

Miki Tebeka miki.tebeka at gmail.com
Sun Nov 20 10:39:36 EST 2011


del sys.modules['my-module']

However if your module imported other modules, they'll still be there.
If there are references to objects your module created, they'll still be there.

A better option IMO is to use imp.find_module and then import.



More information about the Python-list mailing list