[mod_python] "Cannot import name *" error

Graham Dumpleton grahamd at dscpl.com.au
Fri Nov 18 05:16:10 EST 2005

On 18/11/2005, at 8:14 PM, Sebastjan Trepca wrote:

> Hi ho!
> I get this weird import error which doesn't include mod_python
> internal importing system but pythons. The bizzare thing that it
> mostly occours after application is running for a while, day or two.
> [error][client] PythonHandler portal.handler:   File
> "/usr/lib64/python2.4/site-packages/portal/handler.py", line 8, in ?\n
>    from app.modules import golf
> [error] [client] PythonHandler portal.handler:
> ImportError: cannot import name golf
> After "apache2ctl restart" it starts working again. Any clues?

There are numerous issues with mod_python module importing. Read:


Also refer to the mod_python bug reports the second article references.

Depending on what the issue is, it may be addressed in mod_python 3.2,
which looks likely to be released quite soon. This new version still  
quite a number of things broken though and module loading/reloading
issues will probably not be properly fixed until mod_python 3.3.


More information about the Mod_python mailing list