[mod_python] ImportError: No module named linecache

Marty Alchin gulopine at gamemusic.org
Mon Jun 25 21:20:21 EDT 2007

On 6/25/07, Graham Dumpleton <graham.dumpleton at gmail.com> wrote:
> Your only choice it would seem is to start instrumenting the
> mod_python code with debug, ie., write out to log using
> _apache.log_error() at appropriate spots. You may have to move _apache
> import to first in the mod_python.apache file so you can access it and
> write debug between the various imports or where ever else required.
> Suggest that you try dumping out value of __file__ in modules to
> determine where modules are coming from so you know they are coming
> from where you think they should. Also dump out values of sys.path.

Well, I decided to try this out, and I seem to be even more confused
than before. After editing mod_python's apache.py, the same error came
up, with the same line numbers, and without my debugging information.
Initially I thought it was just blindly using the pyc or pyo files
without recompiling from source, so I moved both of them to have a
non-Python location, and it's still using the file as it originally

Am I missing something here? Does this somehow get compiled in somewhere else?


More information about the Mod_python mailing list