title: How to import a module from sub directory
body: <p>I failed to import a module from sub directory in python. Below is my project structure. </p>
  
  <pre><code>./main.py
  ./sub
  ./sub/__init__.py
  ./sub/aname.py
  </code></pre>
  
  <p>when I run <code>python main.py</code>, I got this error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "main.py", line 4, in &lt;module&gt;
      import sub.aname
    File "/Users/dev/python/demo/sub/__init__.py", line 1, in &lt;module&gt;
      from aname import print_func
  ModuleNotFoundError: No module named 'aname'
  </code></pre>
  
  <p>I don't know it failed to load the module <code>aname</code>. Below is the source code:</p>
  
  <p><code>main.py</code>:</p>
  
  <pre><code>#!/usr/bin/python
  
  import sub.aname
  
  print_func('zz')
  </code></pre>
  
  <p><code>sub/__init__.py</code>:</p>
  
  <pre><code>from aname import print_func
  </code></pre>
  
  <p><code>sub/aname.py</code>:</p>
  
  <pre><code>def print_func( par ):
     print ("Hello : ", par)
     return
  </code></pre>
  
  <p>I am using python 3.6.0 on MacOS</p>