How to identify which .pyd files are required for the execution of exe files generated using py2exe module
<p>I have written a python script and generated an exe using py2exe on Windows 32 bit OS. While I'm trying to execute the generated exe file, I'm getting the below error:</p>

<hr>

<pre><code>Traceback (most recent call last):
  File "program01.py", line 3, in &lt;module&gt;
  File "PIL\Image.pyc", line 67, in &lt;module&gt;
  File "PIL\_imaging.pyc", line 12, in &lt;module&gt;
  File "PIL\_imaging.pyc", line 10, in __load
ImportError: DLL load failed: The specified module could not be found.
</code></pre>

<hr>

<p>Is there any way to identify the complete list what .pyd files are required for my program to be executed.</p>

<p>Below is my program import statements.</p>

<pre><code>from __future__ import division
import os, sys, math, aggdraw
from PIL import Image
import xml.etree.ElementTree as ET
import lxml.etree as LETREE
</code></pre>

<p>Any kind of help would be appreciated!!!</p>

<p>Thanks,
Ram</p>

<p>You can include modules by adding <code>options</code> argument into <code>setup</code>:</p>

<pre><code>    options = {'py2exe': {'bundle_files': 1, 'compressed': True, "includes" : ['os', 'sys', 'math', 'aggdraw', 'PIL', 'xml.etree.ElementTree', 'lxml.etree' ]}
   }
</code></pre>

<p>Only thing that could be different in code above is that you might need to replace <code>xml.etree.ElementTree</code> with <code>xml</code> and <code>lxml.etree</code> with <code>lxml</code> as I'm not quite sure about those.</p>

python pydev py2exe pillow pyd