title: AWS Lambda: Unable to import module 'package/file': No module named 'util'
body: <p>I am struggling to get module importing to work in AWS lambda using Python 3.</p>
  
  <p>My file structure looks like this:</p>
  
  <pre><code>package:
    stage1.py
    __init__.py
    util:
      helper1.py
      __init__.py
  </code></pre>
  
  <p><code>helper1.py</code> is a simple util class:</p>
  
  <pre><code>def foo():
    print("yes")
  </code></pre>
  
  <p>Within <code>stage1.py</code> I have the following lines that cause Lambda to throw an error when it is starting:</p>
  
  <pre><code>from util.helper1 import foo
  foo()
  </code></pre>
  
  <pre class="lang-none prettyprint-override"><code>Unable to import module 'package/stage1': No module named 'util'
  </code></pre>
  
  <p>Both <code>__init__.py</code> files are empty.</p>
  
  <p>Sadly, I see that this works if I invoke the script locally. Frustrating is an understatement!</p>