title: How can I fix the relative import error: "with no known parent package"?
body: <p>I have been trying for a couple of days to solve the relative import error in my project with no success.
  I have the following project tree:</p>
  <pre><code>proj
  |
  |---__init__.py
  |
  |---lib
  |    |---__init__.py
  |    |---func.py
  |
  |---src
  |    |---main.py
  </code></pre>
  <ul>
  <li><p>the <code>__init__.py</code> is an empty file.</p>
  </li>
  <li><p>the <code>func.py</code> contains a print function:</p>
  <pre><code>def hello_func():
      print(&quot;Hello !!!&quot;)
  </code></pre>
  </li>
  <li><p>the <code>main.py</code>:</p>
  <pre><code>from ..lib import *
  hello_func()
  </code></pre>
  </li>
  </ul>
  <p>and when I run it I receive this error:</p>
  <pre><code>ImportError: attempted relative import with no known parent package
  </code></pre>
  <p>did anybody face the same problem?</p>