<div class="post-text">
<p>Hi folks,</p><p><i>I've been up one side of the internet and down the other, and haven't seen this question discussed before, but as has often been the case perhaps it's just my search-fu which is weak, in which case, please kindly direct me to the answer or documentation where I can find it. Thanks :)</i></p>
<p>How to distribute a usable python program to a python which doesn't have Distribute installed?</p>
<p>I've created a Windows Binary installer using <code>python setup.py bdist_wininst</code>. The setup.py contains a console script entry point, so that a Windows .exe file is created and placed in <code>%python%\Scripts</code> on the destination machine, as per <a href="http://pythonhosted.org/distribute/setuptools.html#automatic-script-creation" rel="nofollow">Automatic Script Creation</a>.</p>
<p>However running the installed script on a machine with a virgin python install yields:</p>
<pre style class="default prettyprint prettyprinted"><code><span class="pln">D</span><span class="pun">:</span><span class="pln">\Py3</span><span class="pun">.</span><span class="lit">2.5</span><span class="pun">></span><span class="pln"> scripts\foo</span><span class="pun">.</span><span class="pln">exe
</span><span class="typ">Traceback</span><span class="pln"> </span><span class="pun">(</span><span class="pln">most recent call </span><span class="kwd">last</span><span class="pun">):</span><span class="pln">
</span><span class="typ">File</span><span class="pln"> </span><span class="str">"D:\Py3.2.5\scripts\foo-script.py"</span><span class="pun">,</span><span class="pln"> line </span><span class="lit">5</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">in</span><span class="pln"> </span><span class="str"><module></span><span class="pln">
</span><span class="kwd">from</span><span class="pln"> pkg_resources </span><span class="kwd">import</span><span class="pln"> load_entry_point
</span><span class="typ">ImportError</span><span class="pun">:</span><span class="pln"> </span><span class="typ">No</span><span class="pln"> </span><span class="kwd">module</span><span class="pln"> named pkg_resources</span></code></pre>
<p><a href="http://stackoverflow.com/questions/7446187/no-module-named-pkg-resources">No module named pkg_resources</a> tells me this error is because <a href="http://pythonhosted.org/distribute/index.html" rel="nofollow">Distribute</a> is not installed.</p>
<p>How do I get my installer to include Distribute so I don't have to tell our users <em>"before you install our program you have to go install this other program"</em>?</p><p>thanks in advance for your time,</p>
<p></p><p>-matt<br></p></div>