[mod_python] Win32 platform - test installers available

Gregory (Grisha) Trubetskoy grisha at modpython.org
Thu Mar 4 12:19:12 EST 2004

On Thu, 4 Mar 2004, David Fraser wrote:

> Is there a reason there hasn't been a binary made for win32 yet?

mainly because making one is a PITA... i'll get to it some time. if anyone
wants to volunteer, you are more than welcome

> I'll try and look at it myself now, but using VC++ 6 so may be difficult...
> I am using Apache 2.0.48 win32 sources and Python 2.3.3 standard
> distribution...

you shouldn't need apache sources. just install the binary apache
distribution, but remember to click on the "custom" install and include
the header files.

> Compiling Apache for windows is described here:
> http://httpd.apache.org/docs-2.0/platform/win_compiling.html
> That seems to work fine with VC++ 6

see above; no need to compile apache

> Compiling mod_python for windows seems to require compiling in src based
> on the project file for VC++7

i actually use the .net version (is that same as 7?) - sorry, it's the
only thing i have access to.

> I took the vc7to6_prjconverter tool from
> http://www.codeproject.com/tools/prjconverter.asp and converted the file
> for VC++6
> Then I had to manually change paths to point to my Apache include and
> Release (lib) directories and my Python include and libs directories

> (note that I didn't have to compile Python from source as the include
> and libs are included with the standard distribution...)

correct, no need to compile your own Python either

> These originally are set as $(PYTHONSRC) and $(APACHESRC) in the include
> and libs paths.

yes. these are the only things you should set (in system preferences |

> I also had to manually add the srclib/apr/include and
> srclib/apr-util/include directories from Apache to the include path, and
> the srclib/apr/Release and srclib/apr-util/Release directories to the
> library path.

this is because you compiled your own apache

> Then mod_python linked successfully!


> To build the win32 installer it needs to be done in the dist directory
> (apparently under Unix)
> I had troubles trying to run configure on MinGW as it needs an apxs to
> find...
> but the APXS is not actually needed for the setup script (the code that
> used it is commented out)
> So I ran configure on Linux, and built the installer there...
> This is done by copying src/Release/mod_python.so to the dist directory.

not anymore, it now can be done under windows. In fact it *has* to because
this step also compiles _psp.

you DO need to manually create a setup.py from setup.py.in since
./configure, as you noted, won't work on windows

> In fact I found that by simply copying the setup.py generated on Linux I
> could run this on Windows
> The instruction is:
>   setup.py bdist_wininst --install-script=win32_postinstall.py

perhaps distutils take care of it automtically, but I've always
done it separately, building the mod_python package for the standard lib,
which would be a step just before the bdist_wininst.

I had to copy src and mod_python (in lib/python) to under dist (on unix
the makefiles creates symlinks, but they don't work under windows, so you
have to copy), then run

(This has to be run from the VC++ msdos shell, since it will invoke the
compiler to build _psp.so (or _psp.dll, don't remember))

 python setup.py build

> I hope the above instructions are useful to anyone else trying the same
> thing.

me too. And if someone would care to clean up the Windows build process
and make it seamless enough and contribute it as a patch, we would all
very much appreciate it. I personally dislike Windows so much, I don't
know that will ever bring myself to doing this - just building the Windows
installer is already such a horrifying experience that I usually don't
touch Windows for months thereafeter ;-)

> I have not yet fully tested this binary or installer but it seemed to
> run our applications fine.
> mod_python.so and mod_python-3.1.3.win32.exe can be downloaded from:
> http://davidf.sjsoft.com/files/mod_python.so
> http://davidf.sjsoft.com/files/mod_python-3.1.3.win32.exe

See if you can run the tests. You will have to manually rig a testconf.py
(NOTE - it will not like blanks in path names, e.g. "Program Files", the
only work around I found was using the DOS path name, which you can
determine by firing up command.exe (as opposed to cmd.exe) i believe). But
once you get past the testconf.py, usually all tests run OK.

> I would appreciate feedback (on this list) so that hopefully these can
> be included in the official release ...

Thanks for trying!


> David
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python

More information about the Mod_python mailing list