title: Parent module '' not loaded, cannot perform relative import
body: <p>This is the project structure.</p>
  
  <pre><code>--KP
     --app
         --api
             --views
                  --mpg.py
                  --gtt.py
  </code></pre>
  
  <p>mpg.py:</p>
  
  <pre><code>def cmcid():
       .....
       .....
  </code></pre>
  
  <p>gtt.py:</p>
  
  <pre><code>from .mpg import cmcid
  
  def main():
      variable = cmcid()
  if __name__ == "__main__":
      main()
  </code></pre>
  
  <p>when I run from views directory, i.e kp/app/api/views$python gtt.py</p>
  
  <p>I get an error as:</p>
  
  <p>Parent module '' not loaded, cannot perform relative import</p>
  
  <p>Any help is appreciated. Thanks..</p>