Skip to content Skip to sidebar Skip to footer

Reload A Module In Python 3.4

I know this might sound like a really stupid question but whatever. I've made a small script in Python and I've made some changes while in a shell. Normally, on an OS X computer (I

Solution 1:

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)

Post a Comment for "Reload A Module In Python 3.4"