Include .pyd module files in py2exe compilation
Question: I'm trying to compile a python script. On executing the exe I got:-

    
    
    C:\Python27\dist>visualn.exe
    Traceback (most recent call last):
      File "visualn.py", line 19, in <module>
      File "MMTK\__init__.pyc", line 39, in <module>
      File "Scientific\Geometry\__init__.pyc", line 30, in <module>
      File "Scientific\Geometry\VectorModule.pyc", line 9, in <module>
      File "Scientific\N.pyc", line 1, in <module>
    ImportError: No module named Scientific_numerics_package_id
    

I can see the file Scientific_numerics_package_id.pyd at the location
`"C:\Python27\Lib\site-packages\Scientific\win32"`. I want to include this
module file into the compilation. I tried to copy the above file in the "dist"
folder but no good. Any idea?

**Update:** Here is the script:

    
    
    from MMTK import *
    from MMTK.Proteins import Protein
    from Scientific.Visualization import VRML2; visualization_module = VRML2
    protein = Protein('3CLN.pdb')
    center, inertia = protein.centerAndMomentOfInertia()
    distance_away = 8.0
    front_cam = visualization_module.Camera(position= [center[0],center[1],center[2]+distance_away],description="Front")
    right_cam = visualization_module.Camera(position=[center[0]+distance_away,center[1],center[2]],orientation=(Vector(0, 1, 0),3.14159*0.5),description="Right")
    back_cam = visualization_module.Camera(position=[center[0],center[1],center[2]-distance_away],orientation=(Vector(0, 1, 0),3.14159),description="Back")
    left_cam = visualization_module.Camera(position=[center[0]-distance_away,center[1],center[2]],orientation=(Vector(0, 1, 0),3.14159*1.5),description="Left")
    model_name = 'vdw'
    graphics = protein.graphicsObjects(graphics_module = visualization_module,model=model_name)
    visualization_module.Scene(graphics, cameras=[front_cam,right_cam,back_cam,left_cam]).view()
    


Answer: Py2exe lets you specify additional Python modules (both .py and .pyd) via the
`includes` option:

    
    
    setup(
        ...
        options={"py2exe": {"includes": ["Scientific.win32.Scientific_numerics_package_id"]}}
    )
    

EDIT. The above should work if Python is able to

    
    
    import Scientific.win32.Scientific_numerics_package_id
    

