title: How can I uncache imported module in python?
body: <p>This is really freaking me out. My project looks like this</p>
  
  <pre><code>.
  |-- main.py
  |-- classes
  |   |-- __init__.py
  |   |-- exceptions.py
  </code></pre>
  
  <p>In those <code>exceptions.py</code>, I initally created one exception called <code>SecurityError</code>:</p>
  
  <pre><code>class SecurityError(Exception):
      pass   
  </code></pre>
  
  <p>I included the file in <code>main.py</code> using <code>from classes.exceptions import *</code> and <code>SecurityError</code> normally works when I just <code>raise</code> it.</p>
  
  <p>Afterwards, I also added <code>FilesystemError</code>, but whenever using it, I get:</p>
  
  <blockquote>
    <p><strong>global name 'FilesystemError' is not defined</strong></p>
  </blockquote>
  
  <p>I tried to delete <code>*.pyc</code> files in <code>classes</code> directory but it has no effect. Any changes to the <code>exceptions.py</code> take no effect, including any ridiculous ones that make the file invalid:</p>
  
  <pre><code>class FileFOO BAR BAZ systemError(Exception):
      pass
  
  class SecurityErr foo bar bazor(Exception):
      pass    
  </code></pre>
  
  <p>The program still behaves as if the file never changed since the first run. I don't think this behaviour has anything to do with intuitive programming - if there's cache, it should be in that directory.</p>
  
  <p>I am running the python directly from command line:</p>
  
  <pre><code>C:\programing\python\MyProject&gt;py -2 main.py
  </code></pre>