title: Python3 relative imports failing in package
body: <p>I've been reading tons of questions related to this matter but none of the has help me so far. I'm currently using the Python <code>click</code> library to execute scripts as commands. </p>
  
  <p>The current command that I'm trying to execute is placed inside a Python Package which has a <code>__main__.py</code> file, like the parent dir has. The current project structure is the following one.</p>
  
  <pre><code>/myproject
     /foo_one
         __init__.py
         foo_one.py
      /foo_two
         __init__.py
         foo_two.py
      /foo_three
         __init__.py
         foo_three.py
      /foo_four
         __init__.py
         foo_four.py
      /foo_five
         __init__.py
         foo_five.py
      /foo_six
         __init__.py
         foo_six.py
      __init__.py
      __main__.py
      foo_seven.py
  </code></pre>
  
  <p>Whenever I try to run the <code>__main__.py</code> script located in the project folder, the following error comes up.</p>
  
  <p><code>ModuleNotFoundError: No module named '__main__.foo_two'; '__main__' is not a package</code></p>
  
  <p>However, if I try to execute that same script from a folder above with the <code>-m</code> option like this <code>python3 myproject -m</code>, the following is shown up.</p>
  
  <p><code>ImportError: attempted relative import with no known parent package</code></p>
  
  <p>The <code>__main__.py</code> has 2 imports like this... The <code>__init__.py</code> is empty.</p>
  
  <pre><code>from .foo_two.foo_two import AClass, AnotherClass, OtherClass
  from .foo_three.foo_three import AnotherClassMore
  </code></pre>
  
  <p><strong>UPDATE</strong>: Correcting the syntax error in a previous command, while calling <code>python -m myproject</code> gives me a <code>ModuleNotFoundError</code> because of a module that isn't my responsibility, which is basically a library that is used in the project.</p>