How to reload a python module or package ?

Published: August 09, 2021

Tags: Python; Module; Package; Reload;

DMCA.com Protection Status

If you develop your own python module it can be useful to reload it each time you make some change. Examples of how to reload a python module:

Reload a module for Python = 3.4 or >

import importlib

importlib.reload(module)

Reload a module for Python >= 3.0 and < 3.4

import imp

imp.reload(module)

Reload a module for Python = 2

reload(module)

References