title: Can't inspect objects in Spyder created using imported modules
body: <p>I have a python script that uses a class definition from a module in a subdirectory of my project. My main module code looks like this:</p>
  <pre><code>import sys
  sys.path.append('main_module_folder/helper_folder/')
  import helper_module as h
  
  test = h.Foo()
  </code></pre>
  <p>The helper module, which contains the class definition, looks like this:</p>
  <pre><code>class Foo():
      def __init__(self):
          var1 = 'foo'
  </code></pre>
  <p>When I run the main module, the code executes fine. But if I try to inspect the &quot;test&quot; object using the variable explorer in Spyder, I get an error saying &quot;Spyder is unable to show the variable you're trying to view because the module <em>helper_module</em> was not found in the Spyder environment&quot;.</p>
  <p>However, starting from a fresh Ipython instance, if I run &quot;helper_module.py&quot; first, and then modify my main module to remove the import:</p>
  <pre><code># import sys
  # sys.path.append('main_module_folder/helper_folder/')
  # import helper_module as h
  
  test = Foo()
  </code></pre>
  <p>Then I can use the variable explorer to inspect the variable just fine. Why is this? Is there some clean way to import stuff into the main module and still have the objects viewable in the object explorer? I'm running Spyder 4.1.5</p>