title: Problems with relative path import in python
body: <p>I have a project with this directory structure
  <a href="https://i.stack.imgur.com/TsLOf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TsLOf.png" alt="PythonProjectDirectoryStructure"></a></p>
  
  <p>I want to import a def from <code>functions.py</code> from <code>notebook01.ipynb</code>.
  I followed the documentation of relative path import <a href="https://docs.python.org/3/tutorial/modules.html" rel="nofollow noreferrer">here</a> and studied the answers in <a href="https://stackoverflow.com/questions/279237/import-a-module-from-a-relative-path">this stack overflow post</a>.</p>
  
  <p>I tried to write <code>from .Modules.functions import fibonacci</code>, (With one dot before the <code>Modules</code> folder) I got the following error.</p>
  
  <pre><code>ModuleNotFoundError                       Traceback (most recent call last)
  &lt;ipython-input-2-be5f30231faa&gt; in &lt;module&gt;
  ----&gt; 1 from .Modules.functions import fibonacci
  
  ModuleNotFoundError: No module named '__main__.Modules'; '__main__' is not a package
  </code></pre>
  
  <p>And I tried to add two or three dots before the <code>Modules</code> folder <code>from ..Modules.functions import fibonacci</code> then I got the error</p>
  
  <pre><code>ValueError                                Traceback (most recent call last)
  &lt;ipython-input-3-8d1656059c1f&gt; in &lt;module&gt;
  ----&gt; 1 from ..Modules.functions import fibonacci
  
  ValueError: attempted relative import beyond top-level package
  </code></pre>
  
  <p>I have added the <code>__init__.py</code> files at each level of the directory structure as suggested by the documentations]<a href="https://docs.python.org/3/tutorial/modules.html" rel="nofollow noreferrer">2</a> as you see, but no luck at all!</p>
  
  <p>What am I doing wrong?</p>