title: Why simple import of module in same directory is not allowed
body: <p>I've created two modules in the same directory:</p>
  
  <pre><code>.
  ├── mod1.py
  ├── mod2.py
  </code></pre>
  
  <p>There is no <code>__init__.py</code>, I don't want to create this as a package, I'm just creating a simple script which I have modularized by breaking into different modules.</p>
  
  <p>My intention is to run <code>mod1.py</code> using <code>python mod1.py</code></p>
  
  <pre><code>~/junk/imports$ cat mod1.py 
  from . import mod2
  
  print(mod2.some_expr)
  
  
  $ cat mod2.py
  some_expr = 'hello world!'
  </code></pre>
  
  <p>Although I know that directly using <code>import mod1</code> will work, but I'm deliberately not using it so that my module name doesn't clash with built in modules (which I felt is a good practice)</p>
  
  <p>I'm getting the following errors with <code>python2</code> and <code>python3</code></p>
  
  <pre><code>~/junk/imports$ python3 --version
  Python 3.4.3
  kartik@kartik-lappy:~/junk/imports$ python3 mod1.py 
  Traceback (most recent call last):
    File "mod1.py", line 1, in &lt;module&gt;
      from . import mod2
  SystemError: Parent module '' not loaded, cannot perform relative import
  
  
  ~/junk/imports$ python2 --version
  Python 2.7.11
  ~/junk/imports$ python2 mod1.py 
  Traceback (most recent call last):
    File "mod1.py", line 1, in &lt;module&gt;
      from . import mod2
  ValueError: Attempted relative import in non-package
  </code></pre>
  
  <p>Most of the questions like this on StackOverflow deal with packages, but I'm not using packages. I just want to run it as a simple script.</p>
  
  <p>My question is not about how to do it, but I want to know the reason behind the above not working. </p>