title: Relative imports - ModuleNotFoundError: No module named x
body: <p>This is the first time I've really sat down and tried python 3, and seem to be failing miserably. I have the following two files:</p>
  <ol>
  <li>test.py</li>
  <li>config.py</li>
  </ol>
  <p>config.py has a few functions defined in it as well as a few variables. I've stripped it down to the following:</p>
  <p><strong>config.py</strong></p>
  <pre><code>debug = True
  </code></pre>
  <p><strong>test.py</strong></p>
  <pre><code>import config
  print (config.debug)
  </code></pre>
  <p>I also have an <code>__init__.py</code></p>
  <p>However, I'm getting the following error:</p>
  <pre><code>ModuleNotFoundError: No module named 'config'
  </code></pre>
  <p>I'm aware that the py3 convention is to use absolute imports:</p>
  <pre><code>from . import config
  </code></pre>
  <p>However, this leads to the following error:</p>
  <pre><code>ImportError: cannot import name 'config'
  </code></pre>
  <p>So I'm at a loss as to what to do here... Any help is greatly appreciated. :)</p>