<p>Imagine this directory structure:</p>

<pre><code>app/
   __init__.py
   sub1/
      __init__.py
      mod1.py
   sub2/
      __init__.py
      mod2.py
</code></pre>

<p>I'm coding <code>mod1</code>, and I need to import something from <code>mod2</code>. How should I do it?  </p>

<p>I tried <code>from ..sub2 import mod2</code> but I'm getting an "Attempted relative import in non-package".</p>

<p>I googled around but found only "<code>sys.path</code> manipulation" hacks. Isn't there a clean way?  </p>

<hr>

<p>Edit: all my <code>__init__.py</code>'s are currently empty  </p>

<p>Edit2: I'm trying to do this because sub2 contains classes that are shared across sub packages (<code>sub1</code>, <code>subX</code>, etc.).</p>

<p>Edit3: The behaviour I'm looking for is the same as described in <a href="http://www.python.org/dev/peps/pep-0366/" rel="noreferrer">PEP 366</a> (thanks John B)</p>

Everyone seems to want to tell you what you should be doing rather than just answering the question.
The problem is that you're running the module as '__main__' by passing the mod1.py as an argument to the interpreter.
From
PEP 328
:
Relative imports use a module's __name__ attribute to determine that module's position in the package hierarchy. If the module's name does not contain any package information (e.g. it is set to '__main__') then relative imports are resolved as if the module were a top level module, regardless of where the module is actually located on the file system.
In Python 2.6, they're adding the ability to reference modules relative to the main module.
PEP 366
describes the change.
Update
: According to Nick Coghlan, the recommended alternative is to run the module inside the package using the -m switch.