![]()
Building the Windows Extensions from sourcesA few of you have no doubt struggled immensely when attempting to build the Win32 Extensions for Python. So have I :-) Here is my current best effort at documentation for this. The sources are available from the downloads page (or the downloads directory). Building the extensions.These extensions are now built using distutils. setup_win32all.py in the root of
the source tree is the distutils script to use. You will require
Microsoft Visual C++ version 6 (for Python 2.2 and 2.3) or Microsoft
Visual C++ 7 (for Python 2.4 and later). These extensions no
longer build with older Python versions. For detailed instructions on how to build the extensions, run setup_win32all.py without any
parameters. Compiler ConsiderationsKeeping all the various SDKs in place to build all the extensions can be a challenge. Visual C++ 6 is quite old now, and some of these extensions rely of features not available in the standard MSVC headers and libraries. In this case, the distutils script will still try and build as many extensions as possible, but to get them all built you will require some additional downloads. In general, you should also install the latest Microsoft
Platform SDK - this will give you the latest headers and libraries,
regardless of your MSVC version.
MSVC6 Project files, and different Python versionsThis doesn't apply for distutils based builds. However, if you still build from the MSVC6 project files in the tree, there is some magic you must perform to get each Python version built. In general, the source code works with all Python versions.
However, the project files for building PyWinTypes1x.dll and
PythonCOM1x.dll are necessarily different between the two versions, as
the output filename is different. CVS tags are applied to these
files - a Python 2.1 build uses the tag "Python21", and so forth, with
the current CVS Python version being on the head. Thus: cvs -z3 update -r Python21 com/win32com.dsp win32/PyWinTypes.dsp will configure everything for a Python 2.1 build. Also see the
.bat files in the main source directory which will assist in building
for different versions. Most win32all builds are also tagged (eg, build 135 is tagged as "b135"). This should allow you to recreate an exact build. COM Extension modulesMany of the COM extension modules (eg, Move the .pyd files to their respective directories Add a registry key [Wed Jul 27 08:02:53 2005 GMT+10] |