[mod_python] Upgrading 3.2.10 -> 3.3.1

Graham Dumpleton graham.dumpleton at gmail.com
Mon Nov 5 16:54:09 EST 2007

On 06/11/2007, elias.collas at gulfstream.com <elias.collas at gulfstream.com> wrote:
> Hello Graham and thanks for the quick reply.
> Sorry if I'm being dense, but...
> I'm only running a single version of Python (2.4.3) that has mod_python
> 3.2.10 installed in its .../lib/site-packages directory but I'm trying to
> get a second Apache instance to only see mod_python 3.3.1. Is there a way
> to trick Apache to do this? My issue is that I'd rather not move the
> mod_python package which is currently installed (3.2.10) until I test all
> my apps against the latest mod_python.

Not easily done as you can obviously only have one mod_python version
installed into main Python site-packages directory.

A fiddle that should work is for you to create using Ian Bicking's
virtualenv package a distinct Python installation based on your
current one and then install in that all the required new packages you
want to use, including mod_python site-packages components. Then, in
the 'envvars' file in the same directory as your Apache httpd
executable add:


That path should refer to the top directory created by the virtualenv tool.

The Python code when being initialised will see PYTHONHOME and will
use that separate virtual environment as the source of all the Python
modules and not your main installation.

For information on virtualenv see:



> "Graham Dumpleton" <graham.dumpleton at gmail.com> wrote on 11/05/2007
> 04:32:05 PM:
> > If you have installed multiple versions of Python installed in
> > different locations then you must ensure that PATH environment
> > variable of Apache when it starts up finds in that PATH the version
> > you want first. It doesn't actually run it, but Python internal
> > initialisation uses it as a reference point to determine where Python
> > lib directory is located.
> >
> > Graham
> >
> > >
> > >
> > >
> > > _______________________________________________
> > > 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