title: Relative imports and py2app?
body: <p>Here's how my files are laid out:</p>
  
  <pre><code>| setup.py
  + myapp
    | __init__.py
    | myapp.py
    | version.py
  </code></pre>
  
  <p>(Hope that's clear... not too complicated, I don't think.)</p>
  
  <p>Here's what myapp.py contains:</p>
  
  <pre><code>from fingui   import Label
  from .version import __version__
  
  Label('I am version: ' + __version__)
  </code></pre>
  
  <p>If I'm in the directory where I can see <code>setup.py</code>, the following works fine:</p>
  
  <pre><code>python -m myapp.myapp
  </code></pre>
  
  <p>When I try packaging it up as an app using this:</p>
  
  <pre><code>python setup.py py2app
  </code></pre>
  
  <p>And then running it, I get this error message on the line where I import the version:</p>
  
  <pre><code>ValueError: Attempted relative import in non-package
  </code></pre>
  
  <p>Here's the contents of <code>setup.py</code>:</p>
  
  <pre><code>exec(open('myapp/version.py').read())
  
  from setuptools import setup
  
  setup(app                = 'myapp/myapp.py',
        setup_requirements = ['py2app'],
        name               = 'MyApp',
        version            = __version__)
  </code></pre>
  
  <p>If I look into the app bundle that <code>py2app</code> has generated, I see <code>myapp.py</code> is placed in the bundle, but <code>version.py</code> and <code>__init__.py</code> are nowhere to be found.</p>
  
  <p>What is the proper way to structure my files? How can I get <code>py2app</code> and/or <code>setup</code> to recognize which files are necessary and where to put them?</p>
  
  <p>Also, while we're on the subject, how do I get it to include fingui? That's a library that I've installed using pip... I think <code>py2app</code> might be mistaking it for a standard library module or something, so not including it in my app bundle?</p>