title: ModuleNotFoundError: No module named '__main__.xxxx'; '__main__' is not a package
body: <p>Currently trying to work in Python3 and use absolute imports to import one module into another but I get the error <code>ModuleNotFoundError: No module named '__main__.moduleB'; '__main__' is not a package</code>. Consider this project structure:</p>
  
  <pre><code>proj
      __init__.py3 (empty)
      moduleA.py3
      moduleB.py3
  </code></pre>
  
  <p>moduleA.py3</p>
  
  <pre><code>from .moduleB import ModuleB
  ModuleB.hello()
  </code></pre>
  
  <p>moduleB.py3</p>
  
  <pre><code>class ModuleB:
      def hello():
          print("hello world")
  </code></pre>
  
  <p>Then running <code>python3 moduleA.py3</code> gives the error. What needs to be changed here?</p>