title: Why don't relative imports work in Python 3?
body: <p>I recently upgraded from python2.7 to python3 and think it may have screwed up some configurations. Now when I try to run a module, I get import errors. Let's say I have a directory structure like this:</p>
  
  <pre><code>/directory
  /directory/__init__.py
  /directory/run.py
  /directory/app/db.py
  /directory/app/views.py
  /directory/app/__init__.py
  </code></pre>
  
  <p>with the following imports... </p>
  
  <pre><code>/directory/run.py says 'import app'
  /directory/app/db.py says 'import views'
  </code></pre>
  
  <p>When I execute run.py, I get an error saying the module views cannot be found. However, if I go into /directory/app and execute db.py, then the import runs correctly. I've also found that if I change the /directory/app/db.py to say "from app import views" then it works correctly when executing run.py. However, this used to all work!</p>
  
  <p>It seems like the import statements are not taking into account the folder it's being executed in. It seems like this wants me to base all of my imports out of the root folder, which seems incorrect and would take me time to change everything.</p>
  
  <p>Any ideas as to what happened? This has been driving me crazy.</p>