[mod_python] How to make mod_python (Win32) not to relyonregistrykey?

Graham Dumpleton grahamd at dscpl.com.au
Tue Jun 27 18:18:49 EDT 2006


Nicolas Lehuen wrote ..
> I'm not sure this is a mod_python problem, rather a Python problem.
> There is a "Movable Python" project which is precisely what you may
> want : a Python distribution that doesn't need to be installed.
> Apparently the server is down right now, but you'll find it here :
> 
> http://www.voidspace.org.uk/python/movpy/
> 
> Anyway, let me get things clear : what you would like is to be able to
> specify relative paths in the PythonPath directive, right ? So it's
> not related anymore with the need to set environment variable.
> 
> Have you just tried to use the PythonPath directive, and NOT the
> environment variable, providing it absolute paths for a starter ? We
> must first check whether the PythonPath directive solves the problem
> if provided with absolute paths, before trying to patch it to accept
> relative paths.

PythonPath is what I suggested in the first place. Apparently it didn't
work as mod_python callback creation failed. See:

  http://www.modpython.org/pipermail/mod_python/2006-June/021495.html

Unfortunately it is a bit hard to debug why with mod_python 3.2.8
whereas if there was 3.2.9rc? as Win32 package to try, it now generates
lots of debug when callback creation fails to help track down why.

I've wandered in the past whether a PythonHome directive might be
useful. The intent being that mod_python takes that value and populates
PYTHONHOME environment variable before it actually calls init functions
for Python. I saw its use as quite limited so hadn't done anything about
it, but maybe it might have helped in this situation.

Graham

> 2006/6/27, sanja at bougakov.com <sanja at bougakov.com>:
> > It doesn't seem to be the perfect option - it will keep ugly DOS window
> > open all the time Apache works.
> >
> > Maybe someone will suggest how to patch mod_python sources to specify
> > PYTHONPATH relative to the location of mod_python.dll?
> >
> > Yours,
> > Sanja
> >
> >
> > > I think that's the way to go, because it looks like Python doesn't
> > > like the environment variables set by Apache. I need to investigate
> > > more, but your solution, John, is a sure bet.
> > >
> > > Regards,
> > > Nicolas
> > >
> > > 2006/6/27, John Keyes <john.keyes at secantus.com>:
> > >> I think he can still do it if he launches apache from a batch
> > >> file.  Inside this batch file set the PYTHON_HOME.  This
> >
> >
> > _______________________________________________
> > Mod_python mailing list
> > Mod_python at modpython.org
> > http://mailman.modpython.org/mailman/listinfo/mod_python
> >
> _______________________________________________
> 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