title: Relative import module
body: <p>For a project:</p>
  
  <pre><code>    package\
      │
      └───┐ package\
          │
          ├──── __init__.py
          └───┐ subpackage\
              │
              ├──── __init__.py
              └──── spam.py
  </code></pre>
  
  <p>in <code>subpackage\__init__.py</code> I can import <code>spam</code> via:</p>
  
  <pre><code>    from package.subpackage.spam import eggs, beans
  </code></pre>
  
  <p>...or...</p>
  
  <pre><code>    from .spam import eggs, beans
  </code></pre>
  
  <p>The latter is robust to changing the name of the <code>package</code>, which is useful in my current case of a project in early development.</p>
  
  <p>The problem arises when I don't want to actually export anything from <code>spam</code>, I just want it to perform its initialisation logic.</p>
  
  <p>For instance, the following does not work.</p>
  
  <pre><code>    import .spam
  </code></pre>
  
  <p>(I am using <code>PyCharm</code>, which identifies the error, if this is relevant.)</p>
  
  <p>Is there an alternative or standard way to import in this case?</p>