title: Import module from parent directory
body: <p>Take a look at my file structure:</p>
  
  <pre><code>main/
      main.py
      __init__.py
  
      mysql/
          read.py
          __init__.py
  
      conf/
          mysql.py
          loc.py
          __init__.py
  </code></pre>
  
  <p><code>conf/mysql.py</code> contains the information of a mysql server (port,hostname,etc...)</p>
  
  <p><code>read.py</code> is used to acquire and read value from a MySQL DB by connect to the server specified in <code>conf/mysql.py</code>.</p>
  
  <p>What I wanted to achieve is to let <code>read.py</code> import <code>conf/mysql.py</code>, so I tried:</p>
  
  <pre><code>from conf import mysql
  import main.conf.mysql
  </code></pre>
  
  <p>Both of them are not working. It gives me <code>ImportError: No Module Name 'main'</code> and <code>ImportError: No Module Named 'conf'</code>, import <code>conf/mysql.py</code> only work in <code>main.py</code></p>
  
  <p>I know that appending to <code>sys.path</code> will work, but for some reasons, I don't wanna do that.</p>
  
  <p>Any solutions to work around this issue? Thanks in advance and sorry for this complicated question.</p>