[mod_python] Problems with PYTHONPATH.

Hr. Daniel Mikkelsen daniel at copyleft.no
Sat Oct 5 01:23:48 EST 2002


Hi.

I'm experiencing odd behaviour with mod_python and its PYTHONPATH. I'm running
FreeBSD 4.5. I'm not using the port-version of mod_python, since I want use a
separate threadless Python.

Anyway, I've compiled up things, and they basically work. I have my python
version in /local/python-2.2.1-threadless. Mod_python, when ./configuring
detects this from the --with-python=/local/src/Python-2.2.1 I give it.

All very automatic and nice.

But when I fire up Apache with this, things just refuse to work until I add a
symlink from
"/local/python-2.2.1-threadless/lib/python2.2/site-packages/mod_python" to
"/usr/local/lib/python2.2/site-packages".

And when I make my test handler print out sys.path, what I get is the
/usr/local prefixed ones, not the /local/python-2.2.1-threadless ones.

I can't figure out what's going on. The mod_python.so DSO only knows about
/local/python-2.2.1-threadless.

I've worked around this with a PythonPath entry, but I'm very curious as to why
this is happening. Is /usr/local some default prefix Python defaults to? Is
mod_python.so loading /usr/local/lib/python2.2/config/libpython2.2.a somehow by
mistake?

I'm absolutely certain there is only one installation of mod_python on my
system, and that it's configured and compiled with the correct (threadless)
interpreter.

Any help would be appreciated. :)

-- Daniel




More information about the Mod_python mailing list