title: Python interpreter resolves imports, PyDev and nosetests don't
body: <p>I'm using a module from another library I've written in a new library. PyDev and nosetests aren't able to resolve the imports used in my new library, although the Python interpreter is able to do so. The library I'm referencing is stored in my profile site-packages, and I've reconfigured PyDev's PYTHONPATH just to make sure that that folder is included in the path. It is.</p>
  
  <p>The problem looks like this:</p>
  
  <p>My import:</p>
  
  <pre><code>import my_library
  # Here Eclipse says "ID:E1101  Module 'my_library' has no 'MyClass' member"
  print(my_library.MyClass)
  # Here Eclipse shows the same error as above
  class NewClass(my_library.MyClass):
      ...
  </code></pre>
  
  <p>Nonetheless, if I execute the file in the Eclipse terminal OR in my system terminal, the following is printed:</p>
  
  <pre><code>&lt;class 'my_library.my_class.MyClass'&gt;
  </code></pre>
  
  <p>I have tests that are based on an older implementation of the library I'm refactoring and if I run them in the PyDev debugger, they all end with errors. <code>nosetests</code> also returns errors, but if I run the tests manually with <code>python test.py</code> the tests run.</p>
  
  <p>Here's the output of nosetests:</p>
  
  <pre><code>E......
  ======================================================================
  ERROR: Failure: AttributeError ('module' object has no attribute 'MyClass')
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/home/me/.local/lib/python2.7/site-packages/nose-1.3.0-py2.7.egg/nose/loader.py", line 413, in loadTestsFromName
      addr.filename, addr.module)
    File "/home/me/.local/lib/python2.7/site-packages/nose-1.3.0-py2.7.egg/nose/importer.py", line 47, in importFromPath
      return self.importFromDir(dir_path, fqname)
    File "/home/me/.local/lib/python2.7/site-packages/nose-1.3.0-py2.7.egg/nose/importer.py", line 94, in importFromDir
      mod = load_module(part_fqname, fh, filename, desc)
    File "/home/me/development/eclipse/newLibrary/new_library/__init__.py", line 29, in &lt;module&gt;
      from .classes import User, DataPackage
    File "/home/me/development/eclipse/newLibrary/new_library/classes.py", line 37, in &lt;module&gt;
      from .metadata import MetaData
    File "/home/me/development/eclipse/newLibrary/new_library/metadata.py", line 13, in &lt;module&gt;
      print(my_library.MyClass)
  AttributeError: 'module' object has no attribute 'MyClass'
  
  ----------------------------------------------------------------------
  Ran 7 tests in 0.007s
  
  FAILED (errors=1)
  </code></pre>
  
  <p>The PYTHONPATH used by my system and Eclipse seem to be the same (at least I see the site-packages folder that contains my package in my Eclipse settings), and the interpreter is also the same (Python 2.7).</p>
  
  <p>So I see that the import statement works - at least from the command line. But inside Eclipse it doesn't. I've also tried referencing the other project, or dereferencing it, all to no effect. The package import goes through without complaining, but the Eclipse doesn't believe me that the class exists. What's going on?</p>