Reload component from module in Python3
<p>This question is similar to [<a href="https://stackoverflow.com/questions/1739924/python-reload-component-y-imported-with-from-x-import-y">Python: reload component Y imported with &#39;from X import Y&#39;?</a> ]. However, clearly reload doesnt work in python 3.</p>

<p>I initially had</p>

<pre><code>from vb2GP import vb_Estep
</code></pre>

<p>However, due to a bug I modified vb_Estep. When I try to reload using <code>importlib.reload(vb_Estep)</code> I get the error:</p>

<pre><code>  File "&lt;ipython-input-61-72416bca3a93&gt;", line 1, in &lt;module&gt;
    importlib.reload(vb_Estep)

  File "/Users/sachin/anaconda/lib/python3.5/importlib/__init__.py", line 139, in reload
    raise TypeError("reload() argument must be module")

TypeError: reload() argument must be module
</code></pre>

<p>I even tried <code>importlib(vb2GP.vb_Estep)</code> where I get the error <code>NameError: name 'vb2GP' is not defined</code>, which makes sense since I never imported vb2GP to start off with.</p>

<p>So the <strong>question is</strong>, how do you reload compnents in Python3 using <code>importlib</code>.</p>