Reload a Module in Python 3.4 [duplicate] Reload a Module in Python 3.4 [duplicate] python-3.x python-3.x

Reload a Module in Python 3.4 [duplicate]


The imp module was deprecated in Python 3.4 in favor of the importlib module. From the documentation for the imp module:

Deprecated since version 3.4: The imp package is pending deprecation in favor of importlib.

So, you should be using the reload function from there:

>>> import importlib>>> importlib.reload<function reload at 0x01BA4030>>>> importlib.reload(the_module)