How does mod_python know where's Python installed ?
Graham.Dumpleton at gmail.com
Wed Jun 13 01:48:32 CEST 2007
On Jun 13, 7:03 am, arorap <aro... at gmail.com> wrote:
> I recently setupmod_pythonsuccessfully and things work smooth.
> However, I do not remember tellingmod_pythonwhere to find Python
> installation. There's not environment variable which gives that
> information. As such how doesmod_pythonknow where to find Python ?
> When I print sys.path in my scripts it contains my python installation
> folder. I'm wondering how does Apache/mod_pythonget this
> information ?
> I'm running Apache 2.2 on windows.
Rather than duplicate here, for a long explanation see the comments in
in the Python source code.
In short though, it searches for 'python' executable on PATH and from
that tries to determine where the corresponding 'lib' directory is for
the version of Python that mod_python is linked against.
Because it looks in PATH, this will not always work when people have
multiple versions of Python installed on their system with different
base directories. See:
for further details in respect of that problem.
More information about the Python-list