title: Python __init__.py vs sys.path.append/insert
body: <p>I <a href="https://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder">know</a> there <a href="https://stackoverflow.com/questions/72852/how-to-do-relative-imports-in-python">are</a> a <a href="https://stackoverflow.com/questions/10161568/import-python-module-not-on-path">ton</a> of <a href="https://stackoverflow.com/questions/10095037/why-use-sys-path-appendpath-instead-of-sys-path-insert1-path">how-to</a> import <a href="https://stackoverflow.com/questions/3722248/adding-folder-to-pythons-path-permanently">Python modules</a> not in path, but I have yet to come across using Python's <a href="http://docs.python.org/2/tutorial/modules.html" rel="noreferrer">__init.py__</a> vs sys.path.insert. Which method is better? Are there any obvious drawbacks to either, like performance? Is one more "Pythonic?"</p>
  
  <p>One scenario I can think of, is I have a program that users download and put in whatever directory, so I don't know the absolute path (unless I get it programatically). The folder structure is</p>
  
  <pre><code>working dir
      __init__.py
      foo.py
      src/
          my_utils.py
          __init__.py
  </code></pre>
  
  <p>I don't see any difference between using __init__.py or changing sys.path. Is there any scenario you can think of where it would make a difference? </p>
  
  <p>Part 2 of my question is, why do you have to do <i>anything</i> to be able to import modules from subdirectories? I'm fairly new to Python, so maybe I'm not understanding why fiddling with the path or creating <strong>init</strong> files is boilerplate. To me, it seems like an unnecessary complication. If I have "dir" in my current working directory and say "import dir.my_utils," I don't see why I would have to list everything I would want to be able to import in __init__.py.</p>
  
  <p>Apologies if this is a duplicate, but I did search before posting.</p>
  
  <p><b>Edit:</b> Here's another useful link: <a href="https://stackoverflow.com/questions/7250632/automatically-call-common-initialization-code-without-creating-init-py-file">Automatically call common initialization code without creating __init__.py file</a></p>