<p>If all of my <code>__init__.py</code> files are empty, do I have to store them into version control, or is there a way to make <code>distutils</code> create empty <code>__init__.py</code> files during installation?</p>

[{'answer_id': 60431, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 3, 'selected': False, 'text': '<p>In Python, <code>__init__.py</code> files actually have a meaning! They mean that the folder they are in is a Python module. As such, they have a real role in your code and should most probably be stored in Version Control.</p>\n\n<p>You could well imagine a folder in your source tree that is NOT a Python module, for example a folder containing only resources (e.g. images) and no code. That folder would not need to have a <code>__init__.py</code> file in it. Now how do you make the difference between folders where distutils should create those files and folders where it should not ?</p>\n'}, {'answer_id': 60506, 'author': 'dF.', 'author_id': 3002, 'author_profile': 'https://Stackoverflow.com/users/3002', 'pm_score': 3, 'selected': True, 'text': "<p>Is there a reason you want to <em>avoid</em> putting empty <code>__init__.py</code> files in version control? If you do this you won't be able to <code>import</code> your packages from the source directory wihout first running distutils.</p>\n\n<p>If you really want to, I suppose you can create <code>__init__.py</code> in <code>setup.py</code>. It has to be <em>before</em> running <code>distutils.setup</code>, so <code>setup</code> itself is able to find your packages:</p>\n\n<pre><code>from distutils import setup\nimport os\n\nfor path in [my_package_directories]:\n    filename = os.path.join(pagh, '__init__.py')\n    if not os.path.exists(filename):\n        init = open(filename, 'w')\n        init.close()\n\nsetup(\n...\n)\n</code></pre>\n\n<p>but... what would you gain from this, compared to having the empty <code>__init__.py</code> files there in the first place? </p>\n"}]
['https://Stackoverflow.com/questions/60352', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2679/']