title: PyCharm unresolved reference when importing class from other file
body: <p>This problem has been driving me nuts. I am trying to import a class from a file in the same directory. PyCharm is giving me the "Unresolved reference" error. <code>MyClass</code> is defined in <code>file.py</code>.</p>
  
  <p><img src="https://i.stack.imgur.com/hmAnx.png" alt="Unresolved reference"></p>
  
  <p>I have found these questions:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/21236824/unresolved-reference-issue-in-pycharm">Unresolved reference issue in PyCharm</a></li>
  <li><a href="https://stackoverflow.com/questions/20479696/pycharm-unresolved-reference-error-on-the-ide-when-opening-a-working-project">Pycharm: &quot;unresolved reference&quot; error on the IDE when opening a working project</a></li>
  <li><a href="https://stackoverflow.com/questions/11725519/pycharm-shows-unresolved-references-error-for-valid-code">PyCharm shows unresolved references error for valid code</a></li>
  <li><a href="https://stackoverflow.com/questions/17969025/unresolved-reference-when-importing-from-sibling-sub-package-with">Unresolved reference when importing from sibling sub-package with</a></li>
  </ul>
  
  <p>I have the following project structure:</p>
  
  <p><img src="https://i.stack.imgur.com/UOSxE.png" alt="Project structure"></p>
  
  <p>I have marked src as the sources root... </p>
  
  <p>I have set the "Add source roots to PYTHONPATH":</p>
  
  <p><img src="https://i.stack.imgur.com/JzZXM.png" alt="Add sources option"> </p>
  
  <p>I have tried File -> Invalidate Caches / Restart.. (I even restarted the computer).</p>
  
  <p>If I try to run it, I get the following error in the console: <code>ImportError: cannot import name 'MyClass'</code></p>
  
  <p>The interpreter is a virtualenv on Python 3.4 on Ubuntu x64 14.04. </p>
  
  <p>If I install and import any 3rd party packages, they work fine. </p>
  
  <p>If I try <code>echo $PYTHONPATH</code> in the terminal it returns nothing (same with <code>env | grep PYTHONPATH</code>. I have the appropriate virtualenv active when I try these. </p>
  
  <p>Any clues?</p>