title: Import error from parent directory in Python 3.6.9
body: <h1>Problem</h1>
  <p>Hi. I'm having issues importing a module I wrote. The module I want to import is called <code>neural_networks</code>, defined in the <code>neural_networks.py</code> file.</p>
  <p><strong>Directory tree</strong>:</p>
  <pre><code>├── neural_networks.py
  └── directory
      ├── neural_networks.py
      └── calling_module.py
  </code></pre>
  <p><strong>neural_networks.py</strong></p>
  <pre><code>def function_to_import():
      pass
  </code></pre>
  <p>I read Python 3 docs in the section <a href="https://docs.python.org/3/reference/import.html#package-relative-imports" rel="nofollow noreferrer">5.7. Package Relative Imports</a>, and applyed what's written there, but it's not all working.</p>
  <p><strong>calling_module.py</strong></p>
  <pre><code>// ImportError: attempted relative import with no known parent package
  from . import neural_networks
  
  // SyntaxError: invalid syntax
  import ..neural_networks
  
  // ImportError: attempted relative import with no known parent package
  from ..directory import neural_networks
  
  // SyntaxError: invalid syntax
  import .neural_networks
  
  // works and i can use function_to_import() using neural_networks.function_to_import()
  import neural_networks
  </code></pre>
  <h1>Question</h1>
  <p>How can I correctly import and use <code>neural_networks</code> module in <code>calling_module</code>?</p>
  <p>Thanks in advance.</p>