On Mon, Mar 17, 2008 at 4:34 PM, Tim van der Leeuw <tnleeuw@gmail.com> wrote:

On Mon, Mar 17, 2008 at 4:16 PM, M. Adv <mailings@advantages.fr> wrote:

I wrote a script to parse submitted values from a HTML form.
This script works well using the windows cmd command.

My script is named formscript.py

Here is my setup.py

from distutils.core import setup
import py2exe

   # The first three parameters are not required, if at least a
   # 'version' is given, then a versioninfo resource is built from
   # them and added to the executables.
   version = "0.9",
   description = "py2exe sample script",
   name = "py2exe samples",

   # targets to build
   console = ["formscript.py"],

But when I submit the form I have these errors :

 CGI Error

The specified CGI application misbehaved by not returning a complete set
of HTTP headers. The headers it did return are:

Traceback (most recent call last):
 File "C:\Python25\lib\site-packages\py2exe\boot_common.py", line 92, in
   import linecache
ImportError: No module named linecache
Traceback (most recent call last):
 File "formscript.py", line 7, in
ImportError: No module named M2Crypto


Try perhaps adding the following keyword-parameter to your call to the setup() function:

      options = {'py2exe': {
                  'includes': ['win32com', 'win32com.client'],

and replace the includes which I did with the ones relevant to your project.

(See py2exe wiki where you'll most likely find more complete examples using 'includes' options; I hope that my very brief excerpt-of-a-snippet still shows you enough of what to do).